20 lines
641 B
Docker
20 lines
641 B
Docker
FROM node:22-alpine AS builder
|
|
RUN apk add --no-cache openssl
|
|
WORKDIR /app
|
|
COPY package*.json ./
|
|
RUN npm config set registry http://registry.parsaaghayi.ir/repository/npm-proxy/ && npm ci
|
|
COPY . .
|
|
RUN npx prisma generate && npm run build
|
|
|
|
FROM node:22-alpine
|
|
RUN apk add --no-cache openssl
|
|
WORKDIR /app
|
|
COPY --from=builder /app/package*.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
|
|
EXPOSE 3000
|
|
USER node
|
|
CMD ["sh", "-c", "npx prisma migrate deploy && node dist/main"]
|