Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# --- Étape 1: Construire l'application ---
FROM node:20-alpine AS build
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build

# --- Étape 2: Servir l'application avec NGINX ---
FROM nginx:alpine AS final
# Supprimer le contenu par défaut de NGINX
RUN rm -rf /usr/share/nginx/html/*
# Copier les fichiers de construction (ce chemin est standard pour le RealWorld)
COPY --from=build /app/dist/angular-realworld-example-app /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
26 changes: 26 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
version: '3.8'

services:
# Environnement de staging
app-staging:
image: angular-app:staging
container_name: app-staging
ports:
- "8080:80"
restart: unless-stopped
networks:
- app-network

# Environnement de production
app-production:
image: angular-app:production
container_name: app-production
ports:
- "80:80"
restart: unless-stopped
networks:
- app-network

networks:
app-network:
driver: bridge