neue Dockerfile

This commit is contained in:
titver968
2025-04-10 14:52:59 +02:00
parent 591b607d99
commit f5f1befb38

View File

@@ -1,17 +1,32 @@
# --- Build stage ---
FROM node:19 AS build
# --- Build stage ---
FROM node:20 AS build
ENV NODE_ENV=production
ENV ORIGIN=https://tatort.innovation-hub-niedersachsen.de
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . ./
RUN npm run build
ENV PNPM_HOME="/usr/local/lib/node_modules/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Setze den Arbeitsverzeichnis im Container
WORKDIR /usr/src/app
# Installiere pnpm
RUN npm install -g pnpm
# Kopiere package.json und pnpm-lock.yaml in das Arbeitsverzeichnis
COPY package.json pnpm-lock.yaml ./
# Installiere die Abhängigkeiten
RUN pnpm install
# Kopiere den Rest der Anwendung in das Arbeitsverzeichnis
COPY . .
RUN pnpm run build
# --- Production stage ---
FROM node:19-alpine3.16
COPY --from=build /app .
FROM node:20
COPY --from=build /usr/src/app .
ENV HOST=0.0.0.0
EXPOSE 4173
EXPOSE 3000
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"]