-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (25 loc) · 938 Bytes
/
Copy pathDockerfile
File metadata and controls
34 lines (25 loc) · 938 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
32
33
34
### Build stage ##############################################################
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm install --no-audit --no-fund
COPY tsconfig.json ./
COPY src ./src
RUN npm run build
RUN npm prune --omit=dev
### Runtime stage ############################################################
FROM node:20-alpine AS runtime
# docker-cli + the compose v2 plugin so vaultwake can shell out to
# `docker compose down/up -d` against the host's mounted /var/run/docker.sock.
# tini gives us proper signal forwarding.
RUN apk add --no-cache docker-cli docker-cli-compose tini
ENV NODE_ENV=production
ENV PORT=3000
WORKDIR /app
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/dist ./dist
COPY public ./public
COPY package.json README.md LICENSE ./
VOLUME ["/data"]
EXPOSE 3000
ENTRYPOINT ["/sbin/tini", "--", "node", "/app/dist/server.js"]