-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathDockerfile
33 lines (27 loc) · 927 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
# Builds production image for rumors-api.
#
FROM node:18-alpine3.18 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 . .
RUN node_modules/.bin/babel src -d build --extensions ".ts,.js"
RUN npm prune --production
#########################################
FROM node:18-alpine3.18
RUN apk update && apk add ffmpeg
WORKDIR /srv/www
EXPOSE 5000 5500
ENTRYPOINT NODE_ENV=production npm start
COPY --from=builder /srv/www/node_modules ./node_modules
COPY --from=builder /srv/www/build ./build
COPY src/jade ./build/jade
COPY src/adm/README.md ./build/adm/README.md
COPY src/util/protobuf ./build/util/protobuf
COPY package.json package-lock.json ecosystem.config.js ./
COPY static ./static