-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathDockerfile
More file actions
38 lines (26 loc) · 797 Bytes
/
Dockerfile
File metadata and controls
38 lines (26 loc) · 797 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
35
36
37
38
# To build image: docker build --tag tracker-api:1.0 .
# To run image: docker run --network=host --env-file ./.env tracker-api:1.0
# Build image
FROM node:20.20.0-alpine3.22 AS base
WORKDIR /app
FROM base AS builder
COPY package*.json .babelrc ./
RUN npm ci
COPY ./src ./src
COPY ./index.js .
COPY ./lingui.config.js .
COPY ./.env.example .
RUN npm run build
RUN npm prune --production
# Prod image
FROM base AS release
ENV NODE_ENV production
COPY --from=builder /app/package.json .
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/.env.example .
COPY --from=builder /app/index.js .
COPY --from=builder /app/lingui.config.js .
COPY --from=builder /app/dist ./dist
USER node
EXPOSE 4000
CMD ["npm", "start", "--node-options=--dns-result-order=ipv4first"]