84 lines
1.7 KiB
YAML
84 lines
1.7 KiB
YAML
services:
|
|
migrate:
|
|
image: migrate/migrate
|
|
volumes:
|
|
- ./backend/migrations:/migrations
|
|
networks:
|
|
- app-net
|
|
# On attend que la DB soit prête pour lancer les migrations
|
|
command: -path=/migrations/ -database "postgres://admin:admin@db:5432/monitoring?sslmode=disable" up
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
backend:
|
|
build: ./backend
|
|
container_name: backend
|
|
networks:
|
|
- app-net
|
|
depends_on:
|
|
migrate:
|
|
condition: service_completed_successfully
|
|
|
|
frontend:
|
|
build: ./frontend
|
|
container_name: frontend
|
|
networks:
|
|
- app-net
|
|
depends_on:
|
|
- backend
|
|
|
|
# node:
|
|
# build: ./node
|
|
# container_name: node
|
|
# environment:
|
|
# - HOST_IP=192.168.1.75
|
|
# ports:
|
|
# - "8081:8081"
|
|
# networks:
|
|
# - app-net
|
|
# volumes:
|
|
# - node-data:/app
|
|
# depends_on:
|
|
# - backend
|
|
# restart: unless-stopped
|
|
|
|
db:
|
|
image: postgres:16-alpine
|
|
container_name: db
|
|
environment:
|
|
POSTGRES_USER: admin
|
|
POSTGRES_PASSWORD: admin
|
|
POSTGRES_DB: monitoring
|
|
ports:
|
|
- "5432:5432"
|
|
volumes:
|
|
- db-data:/var/lib/postgresql/data
|
|
networks:
|
|
- app-net
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "pg_isready -U admin -d monitoring"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 5
|
|
|
|
nginx:
|
|
image: nginx:alpine
|
|
container_name: monitor-proxy
|
|
ports:
|
|
- "8082:80"
|
|
- "444:443"
|
|
volumes:
|
|
- ./nginx.conf:/etc/nginx/nginx.conf:ro
|
|
depends_on:
|
|
- frontend
|
|
- backend
|
|
networks:
|
|
- app-net
|
|
|
|
networks:
|
|
app-net:
|
|
driver: bridge
|
|
|
|
volumes:
|
|
db-data:
|
|
node-data: |