Complete Docker compose deployment setup
- Add an API container entrypoint that waits for PostgreSQL, runs Prisma migrations, seeds demo data, and then starts NestJS. - Keep Prisma CLI and seed dependencies available in the API runtime image and copy seed source dependencies into the container. - Add Docker Compose healthchecks and health-based startup ordering for PostgreSQL, API, and Nginx web services. - Add Docker initialization environment switches for migrations, seed, and startup retries. - Add a dedicated Docker deployment guide covering services, ports, initialization, HTTPS, production variables, backup, restore, and troubleshooting. - Update README, AGENTS, installation, deployment, progress, and environment example docs for the Dockerized workflow.
This commit is contained in:
@@ -12,10 +12,13 @@ FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
ENV NODE_ENV=production
|
||||
COPY package*.json ./
|
||||
RUN npm ci --omit=dev
|
||||
RUN npm ci
|
||||
COPY --from=builder /app/server/dist ./server/dist
|
||||
COPY --from=builder /app/server/src ./server/src
|
||||
COPY --from=builder /app/server/prisma ./server/prisma
|
||||
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts
|
||||
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
|
||||
COPY scripts/docker-api-entrypoint.sh ./scripts/docker-api-entrypoint.sh
|
||||
RUN chmod +x ./scripts/docker-api-entrypoint.sh
|
||||
EXPOSE 3100
|
||||
CMD ["node", "server/dist/main.js"]
|
||||
CMD ["./scripts/docker-api-entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user