19 lines
624 B
Docker
19 lines
624 B
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
COPY tsconfig.json ./
|
|
COPY src ./src
|
|
RUN npm run build && npm prune --production
|
|
|
|
FROM node:20-alpine
|
|
WORKDIR /app
|
|
RUN addgroup -g 1001 -S nodejs && adduser -S investment -u 1001
|
|
COPY --from=builder --chown=investment:nodejs /app/node_modules ./node_modules
|
|
COPY --from=builder --chown=investment:nodejs /app/dist ./dist
|
|
COPY --from=builder --chown=investment:nodejs /app/package.json ./
|
|
USER investment
|
|
EXPOSE 3093
|
|
HEALTHCHECK --interval=30s --timeout=10s CMD wget -q --spider http://localhost:3093/health || exit 1
|
|
CMD ["node", "dist/index.js"]
|