23 lines
493 B
Docker
23 lines
493 B
Docker
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Copie les fichiers nécessaires
|
|
COPY package*.json ./
|
|
COPY prisma.config.ts ./
|
|
COPY prisma ./prisma/
|
|
COPY tsconfig.json ./
|
|
|
|
# Install deps
|
|
RUN npm ci
|
|
|
|
# Génère le client Prisma dans app/generated/prisma (output défini dans schema.prisma)
|
|
RUN npx prisma generate
|
|
|
|
# Copie le code du worker ET le client Prisma généré
|
|
COPY worker ./worker/
|
|
COPY app/generated ./app/generated/
|
|
|
|
# Lance le worker avec tsx
|
|
CMD ["npx", "tsx", "worker/snapshot-worker.ts"]
|