-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
28 lines (25 loc) · 818 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
FROM node:14.15.3-buster-slim AS NodeBuilder
# Set working directory
WORKDIR /app
# Copy all files from current directory to working dir in image
# except .dockerignore
COPY . .
# install node modules and build assets
RUN yarn install
RUN yarn build
# nginx state for serving content
FROM nginx:alpine
# Set working directory to nginx asset directory
RUN rm /var/log/nginx/access.log \
&& rm /var/log/nginx/error.log \
&& ln -s /dev/stdout /var/log/nginx/access.log \
&& ln -s /dev/stderr /var/log/nginx/error.log
WORKDIR /usr/share/nginx/html
# Remove default nginx static assets
RUN rm -rf ./*
# Copy static assets from builder stage
COPY --from=NodeBuilder /app/build .
EXPOSE 80
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"]
STOPSIGNAL SIGQUIT