Dockerfile aktualisiert
Deploy Standortpruefung / deploy (push) Failing after 8s
Details
Deploy Standortpruefung / deploy (push) Failing after 8s
Details
This commit is contained in:
parent
0828ce1ff2
commit
beb60c8521
12
Dockerfile
12
Dockerfile
|
|
@ -1,4 +1,4 @@
|
||||||
# Nutze Node.js als Basis (LTS Version)
|
# Nutze Node.js als Basis
|
||||||
FROM node:20-alpine AS build
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
|
@ -6,24 +6,26 @@ WORKDIR /app
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
# Kopiere den restlichen Code
|
# Kopiere den restlichen Code (Inklusive der 1,5 GB Daten!)
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Baue das Frontend (erzeugt den 'dist' Ordner)
|
# Baue das Frontend
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
# Finales Image
|
# Finales Image
|
||||||
FROM node:20-alpine
|
FROM node:20-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Installiere nur Production-Abhängigkeiten
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install --production
|
RUN npm install --production
|
||||||
|
|
||||||
# Kopiere das gebaute Frontend und das Backend
|
# Kopiere das gebaute Frontend und das Backend
|
||||||
COPY --from=build /app/dist ./dist
|
COPY --from=build /app/dist ./dist
|
||||||
COPY --from=build /app/server.cjs ./
|
COPY --from=build /app/server.cjs ./
|
||||||
# Die Zeile mit /app/public wurde entfernt, da Vite dies bereits in /dist integriert hat
|
|
||||||
|
# JETZT WIEDER REIN: Kopiere den public Ordner (wo die großen Daten liegen)
|
||||||
|
# Wir kopieren ihn direkt aus dem build-context
|
||||||
|
COPY --from=build /app/public ./public
|
||||||
|
|
||||||
# Der Express-Server läuft auf Port 3000
|
# Der Express-Server läuft auf Port 3000
|
||||||
EXPOSE 3000
|
EXPOSE 3000
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue