All checks were successful
Deploy Canina / deploy (push) Successful in 10m25s
- Remove tsx (Nexus doesn't have it cached - causes E404) - Use ts-node --transpile-only --compiler-options with module:CommonJS to bypass nodenext ESM cycle issue without any new dependencies - Copy tsconfig.json to runtime container for ts-node compatibility
23 lines
830 B
Docker
23 lines
830 B
Docker
FROM node:20-alpine AS builder
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm config set registry http://registry.parsaaghayi.ir/repository/npm-proxy/ && npm ci
|
|
COPY . .
|
|
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
|
|
RUN npx prisma generate && npm run build
|
|
|
|
FROM node:20-alpine
|
|
RUN mkdir -p /app/uploads && chown node:node /app/uploads
|
|
WORKDIR /app
|
|
COPY --from=builder /app/package*.json ./
|
|
COPY --from=builder /app/tsconfig.json ./tsconfig.json
|
|
COPY --from=builder /app/node_modules ./node_modules
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/prisma ./prisma
|
|
COPY --from=builder /app/prisma/scientificTerms.ts ./prisma/scientificTerms.ts
|
|
RUN chown -R node:node /app
|
|
ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x
|
|
EXPOSE 3000
|
|
USER node
|
|
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/main"]
|