-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (20 loc) · 735 Bytes
/
Dockerfile
File metadata and controls
29 lines (20 loc) · 735 Bytes
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
# This is the Dockerfile for the production environment
# builder is a name of the stage
FROM node:18-alpine as builder
# WORKDIR is the working directory for the container
WORKDIR '/app'
# COPY is used to copy the package.json file to the container
COPY package.json .
# RUN is used to run the command in the container
RUN npm install
# COPY is used to copy the rest of the files to the container
COPY . .
# RUN is used to run the command in the container
RUN npm run build
# FROM is used to specify the base image
FROM nginx
# 80 is the port number for nginx
EXPOSE 80
# COPY is used to copy the build files to the nginx container
COPY --from=builder /app/build /usr/share/nginx/html
# docker run -p 8080:80 <container_id>