-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
37 lines (28 loc) · 882 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# naming the build stage as build-stage
FROM node:16.13.0-alpine as build-stage
# Create a app folder
RUN mkdir /app
WORKDIR /app
COPY package*.json /app/
RUN yarn
# Copy the rest of the files
COPY . /app/
# Build the app for production
RUN yarn build
# If there is no tag, it uses the latest
FROM nginx
# work dir 고정
WORKDIR /app
# # work dir 에 build 폴더 생성 /app/build
# # RUN mkdir ./build
# # host pc의 현재경로의 build 폴더를 workdir 의 build 폴더로 복사
# # ADD ./build ./build
# Copy the build files from build-stage to the container
COPY --from=build-stage /app/dist/ /app
# delete default.conf
# RUN rm /etc/nginx/conf.d/default.conf
# copy the nginx.conf from the host computer to the container nginx.conf
COPY ./nginx.conf /etc/nginx/conf.d
EXPOSE 80
# Start the command when the container starts
CMD ["nginx", "-g", "daemon off;"]