-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
46 lines (29 loc) · 965 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
43
44
45
46
FROM node:16-alpine as builder
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=development
COPY . .
RUN npm run build
FROM node:16-alpine as production
ARG NODE_ENV=production
ENV NODE_ENV=$NODE_ENV
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=production
COPY --from=builder /usr/src/app/dist ./dist
RUN set -ex; \
\
apk add --no-cache supervisor \
nginx \
;\
rm -rf /tmp/*; rm -rf /var/cache/apk/*; rm -rf /tmp/pear ~/.pearrc ;\
ln -sf /dev/stdout /var/log/nginx/access.log ;\
ln -sf /dev/stderr /var/log/nginx/error.log
# Suppervisor configuration
COPY ./docker/supervisor/supervisord.prod.conf /etc/supervisord.conf
COPY ./docker/supervisor/supervisor.d /etc/supervisor.d
# Nginx configuration
COPY docker/nginx/nginx.conf /etc/nginx/nginx.conf
COPY docker/nginx/default.conf /etc/nginx/http.d/default.conf
EXPOSE 80
CMD ["supervisord", "-n", "-c", "/etc/supervisord.conf"]