This commit is contained in:
StefanoPutelli 2025-06-28 16:01:31 +02:00
commit 04267b3886
100 changed files with 16495 additions and 0 deletions

26
backend/Dockerfile Normal file
View file

@ -0,0 +1,26 @@
# -------- fase build --------
FROM node:20-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY tsconfig.json ./tsconfig.json
COPY src ./src
RUN npm run build # genera /app/dist
# -------- fase runtime ------
FROM node:20-alpine
WORKDIR /app
ENV NODE_ENV=production
# installa solo dipendenze runtime
COPY --from=builder /app/package*.json ./
RUN npm ci --omit=dev
# copia codice compilato e variabili
COPY --from=builder /app/dist ./dist
COPY .env .env
EXPOSE 6789
CMD ["node", "dist/index.js"]