-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapi.Dockerfile
More file actions
49 lines (36 loc) · 1.04 KB
/
api.Dockerfile
File metadata and controls
49 lines (36 loc) · 1.04 KB
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
47
48
49
FROM docker.io/node:25.9-alpine AS base
WORKDIR /app
RUN apk update && \
apk add \
bash \
curl \
&& \
rm -rf /var/cache/apk/*
FROM base AS deps
WORKDIR /deps
ENV NODE_ENV=production
COPY .npmrc tsconfig.json ./package.json ./package-lock.json ./build-env.js /deps/
COPY ./src/ /deps/src/
RUN npm ci && \
npm dedupe && \
npm prune && \
npx --yes modclean --run
FROM base AS build
WORKDIR /build
ENV NODE_ENV=production
COPY --from=deps /deps/ /build/
RUN npm run copyfiles && \
npm run build:server
FROM base AS run
WORKDIR /app
ENV NODE_ENV=production
COPY --from=build /build/node_modules/ /app/node_modules/
COPY --from=build /build/dist/ /app/dist/
COPY ./package.json /app/
COPY ./docker-entrypoint /docker-entrypoint/
COPY ./docker-entrypoint.sh /docker-entrypoint/
RUN chmod +x /docker-entrypoint/docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint/docker-entrypoint.sh"]
ENV PAYLOAD_CONFIG_PATH=dist/mzinga.config.js \
NODE_ENV=production
CMD ["node", "--require", "./dist/tracing.js", "dist/server.js"]