forked from cofacts/rumors-line-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 766 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
FROM node:16-alpine AS builder
WORKDIR /srv/www
# make node_modules cached.
# Src: https://nodesource.com/blog/8-protips-to-start-killing-it-when-dockerizing-node-js/
#
COPY package.json package-lock.json ./
RUN npm install
# Other files, so that other files do not interfere with node_modules cache
#
COPY . .
ARG LOCALE=en_US
RUN NODE_ENV=production npm run build
RUN npm prune --production
#########################################
FROM node:16-alpine
WORKDIR /srv/www
EXPOSE 5001
ENTRYPOINT NODE_ENV=production npm start
COPY package.json package-lock.json ecosystem.config.js ./
COPY i18n i18n
COPY static static
COPY --from=builder /srv/www/node_modules ./node_modules
COPY --from=builder /srv/www/build ./build
COPY --from=builder /srv/www/liff ./liff