Skip to content

Commit e560228

Browse files
author
App Generator
committed
Added Docker Support
1 parent 4f5e45b commit e560228

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed

Dockerfile

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# pull official base image
2+
FROM node:14-alpine
3+
4+
# set working directory
5+
WORKDIR /app
6+
7+
# add `/app/node_modules/.bin` to $PATH
8+
ENV PATH /app/node_modules/.bin:$PATH
9+
10+
# install app dependencies
11+
COPY package.json ./
12+
RUN npm install --silent
13+
RUN npm install react-scripts@4.0.0 -g --silent
14+
15+
# add app
16+
COPY . ./
17+
18+
# Expose port
19+
EXPOSE 3000
20+
21+
# start app
22+
CMD ["npm", "start"]

docker-compose.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: '3.7'
2+
3+
services:
4+
5+
sample:
6+
container_name: react-soft-ui
7+
build:
8+
context: .
9+
dockerfile: Dockerfile
10+
volumes:
11+
- '.:/app'
12+
- '/app/node_modules'
13+
ports:
14+
- 3000:3000
15+
environment:
16+
- CHOKIDAR_USEPOLLING=true
17+

0 commit comments

Comments
 (0)