Dockerfile

This commit is contained in:
titver968
2025-04-10 16:00:44 +02:00
parent aa598e7943
commit 9b02c40c3f

View File

@@ -1,9 +1,5 @@
# --- Build stage ---
FROM node:22-bullseye AS build
ENV NODE_ENV=production
ENV ORIGIN=https://tatort.innovation-hub-niedersachsen.de
ENV PNPM_HOME="/usr/local/lib/node_modules/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# Verwende ein offizielles Node.js-Image als Basis-Image
FROM node:22
# Setze den Arbeitsverzeichnis im Container
WORKDIR /usr/src/app
@@ -18,19 +14,13 @@ COPY package.json pnpm-lock.yaml ./
RUN pnpm install
# Kopiere den Rest der Anwendung in das Arbeitsverzeichnis
COPY . ./
COPY . .
RUN pnpm run build
# Setze die Umgebungsvariable, um pnpm zu verwenden
ENV PNPM_HOME="/usr/local/lib/node_modules/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
# --- Production stage ---
FROM node:22-bullseye AS production
WORKDIR /usr/src/app
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --production
COPY --from=build /usr/src/appi/dist ./dist
ENV HOST=0.0.0.0
# Exponiere den Port, auf dem die Anwendung läuft
EXPOSE 3000
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"]