Maj
This commit is contained in:
+23
-14
@@ -1,15 +1,12 @@
|
|||||||
version: "3.9"
|
version: "3.9"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
backend:
|
crowdlending-backend:
|
||||||
build:
|
build:
|
||||||
context: ./backend
|
context: ./backend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: crowdlending-backend
|
container_name: crowdlending-backend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
# Port exposé uniquement en dev local — en prod, nginx proxie en interne
|
|
||||||
# ports:
|
|
||||||
# - "4000:4000"
|
|
||||||
env_file:
|
env_file:
|
||||||
- .env
|
- .env
|
||||||
environment:
|
environment:
|
||||||
@@ -18,16 +15,18 @@ services:
|
|||||||
DB_PATH: /app/data/crowdlending.db
|
DB_PATH: /app/data/crowdlending.db
|
||||||
UPLOAD_DIR: /app/uploads
|
UPLOAD_DIR: /app/uploads
|
||||||
volumes:
|
volumes:
|
||||||
- backend_data:/app/data
|
- ../volumes/crowdlending/data:/app/data
|
||||||
- backend_uploads:/app/uploads
|
- ../volumes/crowdlending/uploads:/app/uploads
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "node", "-e", "fetch('http://localhost:4000/api/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
|
test: ["CMD", "node", "-e", "fetch('http://localhost:4000/api/health').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 3
|
retries: 3
|
||||||
start_period: 10s
|
start_period: 10s
|
||||||
|
networks:
|
||||||
frontend:
|
- internal
|
||||||
|
|
||||||
|
crowdlending-frontend:
|
||||||
build:
|
build:
|
||||||
context: ./frontend
|
context: ./frontend
|
||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
@@ -35,12 +34,22 @@ services:
|
|||||||
VITE_API_URL: /api
|
VITE_API_URL: /api
|
||||||
container_name: crowdlending-frontend
|
container_name: crowdlending-frontend
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
ports:
|
|
||||||
- "8080:80"
|
|
||||||
depends_on:
|
depends_on:
|
||||||
backend:
|
backend:
|
||||||
condition: service_healthy
|
condition: service_healthy
|
||||||
|
labels:
|
||||||
volumes:
|
- "traefik.enable=true"
|
||||||
backend_data:
|
- "traefik.http.routers.crowdlending.rule=Host(`crowdlending.croguennec.net`)"
|
||||||
backend_uploads:
|
- "traefik.http.routers.crowdlending.entrypoints=websecure"
|
||||||
|
- "traefik.http.routers.crowdlending.tls.certresolver=le"
|
||||||
|
- "traefik.http.routers.crowdlending.middlewares=ipwhitelist-all"
|
||||||
|
- "traefik.http.services.crowdlending.loadbalancer.server.port=80"
|
||||||
|
networks:
|
||||||
|
- internal
|
||||||
|
- backend # réseau Traefik
|
||||||
|
|
||||||
|
networks:
|
||||||
|
internal: # communication interne backend <-> frontend
|
||||||
|
driver: bridge
|
||||||
|
backend: # réseau partagé avec Traefik
|
||||||
|
external: true
|
||||||
Reference in New Issue
Block a user