Files
FEDEO/Dockerfile
2025-09-12 19:27:21 +02:00

29 lines
561 B
Docker

# Basis-Image
FROM node:20-alpine AS base
WORKDIR /usr/src/app
# Dependencies installieren (dev deps für Build erforderlich)
COPY package*.json ./
RUN npm install
# Quellcode kopieren
COPY . .
# Build ausführen (TypeScript -> dist)
RUN npx tsc --transpileOnly
# --------- Production Stage ---------
FROM node:20-alpine AS production
WORKDIR /usr/src/app
# Nur production dependencies installieren
COPY package*.json ./
RUN npm install --omit=dev
COPY --from=base /usr/src/app/dist ./dist
# Port freigeben
EXPOSE 3100
# App starten
CMD ["npm", "start"]