Sostituito frontend-angular-new con frontend-angular
This commit is contained in:
+28
-12
@@ -1,20 +1,36 @@
|
||||
# Frontend Angular Dockerfile
|
||||
FROM node:20-alpine
|
||||
# ========================================
|
||||
# Frontend Angular Dockerfile (multi-stage)
|
||||
# ========================================
|
||||
|
||||
# Set working directory
|
||||
FROM node:20-alpine AS base
|
||||
WORKDIR /app
|
||||
|
||||
# Copy package files
|
||||
COPY package*.json ./
|
||||
|
||||
# Install dependencies
|
||||
# ========================================
|
||||
# Development: ng serve con hot reload
|
||||
# ========================================
|
||||
FROM base AS development
|
||||
RUN npm install
|
||||
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Expose port
|
||||
EXPOSE 4200
|
||||
|
||||
# Start development server
|
||||
CMD ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
|
||||
|
||||
# ========================================
|
||||
# Build: bundle statico di produzione
|
||||
# ========================================
|
||||
FROM base AS build
|
||||
RUN npm install
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
# Nota: la build SSR (server.ts/main.server.ts) non è al momento agganciata
|
||||
# ad angular.json ("server" builder option assente), quindi ng build produce
|
||||
# solo il bundle browser in dist/app/browser/. Se in futuro si abilita la SSR,
|
||||
# questo stage andrà aggiornato per servire dist/app/server con Node invece di nginx.
|
||||
|
||||
# ========================================
|
||||
# Production: bundle statico servito da nginx
|
||||
# ========================================
|
||||
FROM nginx:1.27-alpine AS production
|
||||
COPY --from=build /app/dist/app/browser /usr/share/nginx/html
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
|
||||
Reference in New Issue
Block a user