-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
42 lines (30 loc) · 942 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
38
39
40
41
42
# Stage 1
#######################################
# Pull official node image
FROM node:16.13.2-buster-slim AS builder
# Set working directory
WORKDIR /app
# Copy package.json and package-lock.json to Docker environment
COPY package.json ./
# Installs all node packages
RUN npm install
# Copies everything over to Docker environment
COPY . ./
RUN npm run build
#Stage 2
#######################################
# Pull the official nginx base image
FROM nginx:1.25.1
# Set working directory to nginx resources directory
WORKDIR /usr/share/nginx/html
# Remove default nginx static resources
RUN rm -rf ./*
# Copies static resources from builder stage
COPY --from=builder /app/build .
COPY ./default.conf /etc/nginx/conf.d/default.conf
COPY ./start.sh /docker-entrypoint.d
ENTRYPOINT ["/docker-entrypoint.sh"]
EXPOSE 80
STOPSIGNAL SIGQUIT
# Containers run nginx with global directives and daemon off
CMD ["nginx", "-g", "daemon off;"]