-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (23 loc) · 695 Bytes
/
Copy pathDockerfile
File metadata and controls
31 lines (23 loc) · 695 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
30
31
## Build image
FROM node:16 as application
WORKDIR /var/app
COPY package.json package-lock.json* ./
RUN npm ci && npm cache clean --force
COPY ./ .
RUN npm run build
## Final image
FROM nginx:alpine
# set timezone to GMT time zone
# replace shell with bash
# install base dependencies
ENV TZ=GMT
RUN echo $TZ > /etc/timezone \
&& echo $TZ > /etc/localtime \
&& apk update \
&& apk upgrade
## Custom NGINX settings
COPY --from=application /var/app/docker-configs/nginx.conf /etc/nginx/nginx.conf
COPY --from=application /var/app/docker-configs/default.conf /etc/nginx/conf.d/default.conf
## Application folder
WORKDIR /usr/share/nginx/html
COPY --from=application /var/app/public .