Skip to content

Commit af9de3c

Browse files
author
nobo_devops
committed
add dockerfile
1 parent 32b3432 commit af9de3c

2 files changed

Lines changed: 36 additions & 0 deletions

File tree

Dockerfile

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

docker-compose.yaml

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

0 commit comments

Comments
 (0)