neue Dockerfile
This commit is contained in:
33
Dockerfile
33
Dockerfile
@@ -1,17 +1,32 @@
|
|||||||
# --- Build stage ---
|
# --- Build stage ---
|
||||||
FROM node:19 AS build
|
FROM node:20 AS build
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV ORIGIN=https://tatort.innovation-hub-niedersachsen.de
|
ENV ORIGIN=https://tatort.innovation-hub-niedersachsen.de
|
||||||
WORKDIR /app
|
ENV PNPM_HOME="/usr/local/lib/node_modules/pnpm"
|
||||||
COPY package*.json ./
|
ENV PATH="$PNPM_HOME:$PATH"
|
||||||
RUN npm ci
|
|
||||||
COPY . ./
|
# Setze den Arbeitsverzeichnis im Container
|
||||||
RUN npm run build
|
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 ---
|
# --- Production stage ---
|
||||||
FROM node:19-alpine3.16
|
FROM node:20
|
||||||
COPY --from=build /app .
|
COPY --from=build /usr/src/app .
|
||||||
ENV HOST=0.0.0.0
|
ENV HOST=0.0.0.0
|
||||||
EXPOSE 4173
|
EXPOSE 3000
|
||||||
|
|
||||||
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"]
|
CMD ["sh", "-c", "ORIGIN=https://tatort.innovation-hub-niedersachsen.de node build/index.js"]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user