forked from mtusi2026/mtusi2026lab2
feat: persist messenger data and sessions in PostgreSQL
This commit is contained in:
+27
@@ -0,0 +1,27 @@
|
||||
FROM node:24.22.1-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --ignore-scripts --no-audit --no-fund
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
FROM node:24.22.1-bookworm-slim AS production-dependencies
|
||||
WORKDIR /app
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci --omit=dev --ignore-scripts --no-audit --no-fund
|
||||
|
||||
FROM node:24.22.1-bookworm-slim AS runtime
|
||||
ENV NODE_ENV=production APP_HOST=0.0.0.0 APP_PORT=8080 LOG_LEVEL=info
|
||||
WORKDIR /app
|
||||
COPY --from=production-dependencies /app/node_modules ./node_modules
|
||||
COPY --from=build /app/dist ./dist
|
||||
COPY package.json ./
|
||||
COPY contracts/openapi.json ./contracts/openapi.json
|
||||
COPY migrations ./migrations
|
||||
USER node
|
||||
EXPOSE 8080
|
||||
STOPSIGNAL SIGTERM
|
||||
HEALTHCHECK --interval=5s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD ["node", "--input-type=module", "-e", "const r = await fetch('http://127.0.0.1:' + process.env.APP_PORT + '/health/ready', {signal: AbortSignal.timeout(2000)}); if (r.status !== 200) process.exit(1)"]
|
||||
CMD ["node", "dist/server.js"]
|
||||
Reference in New Issue
Block a user