2026-10-24 14:41:31 +03:30
|
|
|
# NestJS API. Pre-built output: `pnpm build` bundles it into apps/api/.output (apps/api/scripts/bundle.mjs).
|
2026-10-21 20:31:05 +03:30
|
|
|
# docker build -f docker/api.Dockerfile -t imen-api . # API server
|
|
|
|
|
# docker build -f docker/api.Dockerfile --target migrate -t imen-migrate . # one-off migrations
|
|
|
|
|
ARG NODE_IMAGE=docker.arvancloud.ir/node:24-alpine
|
|
|
|
|
|
2026-10-24 14:41:31 +03:30
|
|
|
FROM ${NODE_IMAGE} AS app
|
2026-10-21 20:31:05 +03:30
|
|
|
WORKDIR /app
|
2026-10-24 14:41:31 +03:30
|
|
|
ENV NODE_ENV=production
|
|
|
|
|
COPY apps/api/.output ./
|
|
|
|
|
COPY apps/api/prisma/migrations ./prisma/migrations
|
|
|
|
|
COPY apps/api/seed-assets ./seed-assets
|
|
|
|
|
|
|
|
|
|
# applies pending migrations and exits
|
|
|
|
|
FROM app AS migrate
|
|
|
|
|
CMD ["node", "dist/migrate.js"]
|
|
|
|
|
|
|
|
|
|
FROM app AS runtime
|
|
|
|
|
ENV PORT=4000
|
2026-10-21 20:31:05 +03:30
|
|
|
USER node
|
|
|
|
|
EXPOSE 4000
|
|
|
|
|
CMD ["node", "dist/main.js"]
|