FIx some for production again

This commit is contained in:
Montech
2026-09-15 17:26:42 +03:30
parent afde44ab8a
commit 3bc97461e0
195 changed files with 258003 additions and 344 deletions
+12 -21
View File
@@ -1,28 +1,19 @@
FROM node:20-alpine AS builder
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN apk add --no-cache openssl
RUN corepack enable pnpm
FROM docker.arvancloud.ir/node:20-bookworm
# Pre-built on the developer machine:
# pnpm build:release
# NOTE: full "bookworm" (not -slim/-alpine) on purpose — Prisma's query engine
# links against libssl.so.3, which the slim/alpine variants do not ship, and the
# deploy host cannot reach apt/apk mirrors to install it.
WORKDIR /app
COPY . .
ENV NODE_ENV=production
# Vendored Prisma lives in ./vendor (not node_modules — that path is gitignored)
ENV NODE_PATH=/app/vendor
ENV PRISMA_QUERY_ENGINE_LIBRARY=/app/vendor/.prisma/client/libquery_engine-debian-openssl-3.0.x.so.node
RUN pnpm install --frozen-lockfile
RUN pnpm --filter @lucky-wheel/api exec prisma generate
RUN pnpm run build:types
RUN pnpm --filter @lucky-wheel/api build
RUN pnpm deploy --filter @lucky-wheel/api --prod /prod/api
RUN cp -r /app/node_modules/.pnpm/@prisma+client* /prod/api/node_modules/.pnpm/
FROM node:20-alpine AS runner
RUN apk add --no-cache openssl
WORKDIR /app
COPY --from=builder /prod/api .
COPY release/ ./
EXPOSE 3000
CMD ["node", "dist/src/main"]
CMD ["node", "app.js"]