-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
41 lines (28 loc) · 944 Bytes
/
Dockerfile
File metadata and controls
41 lines (28 loc) · 944 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
39
40
41
FROM node:20-alpine AS builder
WORKDIR /app
COPY package.json package-lock.json* .npmrc ./
ARG NPM_TOKEN
RUN echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> .npmrc && \
npm ci --ignore-scripts && \
rm -f .npmrc
COPY tsconfig.json tsconfig.build.json nest-cli.json ./
COPY src/ src/
RUN npm run build
# --- Runtime ---
FROM node:20-alpine
WORKDIR /app
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
COPY package.json package-lock.json* .npmrc ./
ARG NPM_TOKEN
RUN echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> .npmrc && \
npm ci --ignore-scripts --omit=dev && \
npm cache clean --force && \
rm -f .npmrc
COPY --from=builder /app/dist dist/
COPY --from=builder /app/node_modules/@multiagentcoordinationprotocol/proto node_modules/@multiagentcoordinationprotocol/proto
COPY drizzle/ drizzle/
USER appuser
ENV NODE_ENV=production
ENV PORT=3001
EXPOSE 3001
CMD ["node", "dist/main.js"]