sdfsdf
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -1,22 +1,15 @@
|
|||||||
# Stage 1: Build
|
# Stage 1: Build
|
||||||
FROM node:22-alpine AS build
|
FROM node:20-alpine AS build
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
# Dependencies installieren (Caching nutzen)
|
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
# Code kopieren und bauen (kopiert dank nest-cli.json auch die .hbs/.assets)
|
|
||||||
COPY . .
|
COPY . .
|
||||||
RUN npm run build
|
RUN npm run build --configuration=production
|
||||||
|
|
||||||
# Stage 2: Production Run
|
# Stage 2: Serve
|
||||||
FROM node:22-alpine
|
FROM nginx:alpine
|
||||||
WORKDIR /app
|
# Passe den Pfad an, falls dein Output-Ordner in angular.json anders heißt!
|
||||||
# Nur Production-Dependencies installieren (hält das Image extrem klein!)
|
COPY --from=build /app/dist/bay-area-affiliates/browser /usr/share/nginx/html
|
||||||
COPY package*.json ./
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
RUN npm install --omit=dev
|
EXPOSE 80
|
||||||
# Kompilierten Code aus Stage 1 übernehmen
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
COPY --from=build /app/dist ./dist
|
|
||||||
|
|
||||||
# NestJS Standard-Port
|
|
||||||
EXPOSE 3000
|
|
||||||
CMD ["node", "dist/main"]
|
|
||||||
Reference in New Issue
Block a user