access to whole repo
This commit is contained in:
parent
ae12eb87f0
commit
36ef7eb4bf
|
|
@ -0,0 +1,6 @@
|
|||
node_modules
|
||||
.git
|
||||
.idea
|
||||
.vscode
|
||||
dist
|
||||
coverage
|
||||
|
|
@ -1,25 +1,41 @@
|
|||
# STAGE 1: Build
|
||||
FROM node:22-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
|
||||
# Wir erstellen ein Arbeitsverzeichnis, das eine Ebene über dem Projekt liegt
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
# 1. Wir kopieren die Backend-Models an die Stelle, wo Angular sie erwartet
|
||||
# Deine Pfade suchen nach ../bizmatch-server, also legen wir es daneben.
|
||||
COPY bizmatch-server/src/models ./bizmatch-server/src/models
|
||||
|
||||
# 2. Jetzt kümmern wir uns um das Frontend
|
||||
# Wir kopieren erst die package Files für besseres Caching
|
||||
COPY bizmatch/package*.json ./bizmatch/
|
||||
|
||||
# Wechseln in den Frontend Ordner zum Installieren
|
||||
WORKDIR /usr/src/app/bizmatch
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
# Wir bauen die SSR Version
|
||||
|
||||
# 3. Den Rest des Frontends kopieren
|
||||
COPY bizmatch/ .
|
||||
|
||||
# 4. Bauen
|
||||
RUN npm run build:ssr
|
||||
|
||||
# STAGE 2: Run
|
||||
# --- STAGE 2: Runtime ---
|
||||
FROM node:22-alpine
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Kopiere den gebauten 'dist' Ordner aus Stage 1
|
||||
COPY --from=builder /app/dist /app/dist
|
||||
COPY --from=builder /app/package*.json /app/
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=4000
|
||||
|
||||
# Kopiere das Ergebnis aus dem Builder (Pfad beachten!)
|
||||
COPY --from=builder /usr/src/app/bizmatch/dist /app/dist
|
||||
COPY --from=builder /usr/src/app/bizmatch/package*.json /app/
|
||||
|
||||
# Installiere nur Dependencies für die Laufzeit (Express, etc.)
|
||||
RUN npm ci --omit=dev
|
||||
|
||||
# Standard SSR Port ist oft 4000, wir setzen ihn explizit
|
||||
ENV PORT=4000
|
||||
EXPOSE 4000
|
||||
|
||||
CMD ["node", "dist/bizmatch/server/server.mjs"]
|
||||
|
|
|
|||
|
|
@ -2,9 +2,9 @@ services:
|
|||
# --- FRONTEND ---
|
||||
bizmatch-ssr:
|
||||
build:
|
||||
context: ./bizmatch # Pfad zum Angular Ordner
|
||||
dockerfile: Dockerfile
|
||||
image: bizmatch-ssr:latest
|
||||
context: . # Pfad zum Angular Ordner
|
||||
dockerfile: bizmatch/Dockerfile
|
||||
image: bizmatch-ssr
|
||||
container_name: bizmatch-ssr
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
|
|
|
|||
Loading…
Reference in New Issue