Enable auth-service/api-gateway on production, build their images in CI
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
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/auth-service/package.json apps/auth-service/package.json
|
||||
COPY packages/shared-types/package.json packages/shared-types/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/auth-service/ apps/auth-service/
|
||||
RUN pnpm --filter @duoc-thu/auth-service build
|
||||
|
||||
FROM base AS runtime
|
||||
ENV NODE_ENV=production
|
||||
COPY --from=build /repo /repo
|
||||
WORKDIR /repo/apps/auth-service
|
||||
EXPOSE 3010
|
||||
CMD ["node", "dist/main.js"]
|
||||
Reference in New Issue
Block a user