Enable auth-service/api-gateway on production, build their images in CI
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
FROM node:20-slim AS base
|
||||
RUN corepack enable
|
||||
WORKDIR /repo
|
||||
|
||||
FROM base AS deps
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
||||
COPY apps/api-gateway/package.json apps/api-gateway/package.json
|
||||
COPY packages/config/package.json packages/config/package.json
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
FROM deps AS build
|
||||
COPY packages/ packages/
|
||||
COPY apps/api-gateway/ apps/api-gateway/
|
||||
RUN pnpm --filter @duoc-thu/api-gateway build
|
||||
|
||||
FROM base AS runtime
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=build /repo /repo
|
||||
WORKDIR /repo/apps/api-gateway
|
||||
EXPOSE 3000
|
||||
CMD ["node", "dist/main.js"]
|
||||
Reference in New Issue
Block a user