-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
116 lines (111 loc) · 3.8 KB
/
docker-compose.yml
File metadata and controls
116 lines (111 loc) · 3.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
services:
app:
build: &django_build
context: .
dockerfile: Dockerfile
args:
DEBUG: ${DEBUG:-0}
SECRET_KEY: ${SECRET_KEY:-dev-secret-key-change-in-production}
ports:
- 8000
environment:
DEBUG: ${DEBUG:-0}
SECRET_KEY: ${SECRET_KEY:-dev-secret-key-change-in-production}
DATABASE_URL: ${DATABASE_URL:-postgresql://eu_fact_force:eu_fact_force@postgres:5432/eu_fact_force}
AWS_S3_ENDPOINT_URL: ${AWS_S3_ENDPOINT_URL:-http://minio:9000}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-minioadmin}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-minioadmin}
AWS_S3_REGION_NAME: ${AWS_S3_REGION_NAME:-eu-west-1}
AWS_STORAGE_BUCKET_NAME: ${AWS_STORAGE_BUCKET_NAME:-eu-fact-force-files}
SERVICE_FQDN_APP_8000:
volumes:
- .:/app
- hf_cache:/hf_cache
depends_on:
postgres:
condition: service_healthy
minio-init:
condition: service_completed_successfully
labels:
- traefik.enable=true
- traefik.http.routers.eu-fact-force.rule=Host(`eu-fact-force.services.d4g.fr`)
- traefik.http.routers.eu-fact-force.entryPoints=webtls
- traefik.http.routers.eu-fact-force.tls=true
- traefik.docker.network=d4g-internal
- traefik.http.services.eu-fact-force.loadbalancer.server.port=8000
# Dash visualization UI. Reuses the same image as `app` (dash, dash-bootstrap-components,
# dash-cytoscape are already in the runtime deps). Overrides entrypoint so it doesn't run
# Django migrations.
dash:
build: *django_build
ports:
- 8050
environment:
BACKEND_URL: http://app:8000
DASH_HOST: 0.0.0.0
DASH_PORT: 8050
SERVICE_FQDN_DASH_8050:
volumes:
- .:/app
working_dir: /app/eu_fact_force/dash-app
entrypoint: null
command: ["uv", "run", "--no-sync", "python", "app.py"]
depends_on:
- app
# PostgreSQL 18+ : monter sur /var/lib/postgresql (l’image gère le sous-dossier de version).
postgres:
image: pgvector/pgvector:pg18-trixie
environment:
POSTGRES_USER: ${POSTGRES_USER:-eu_fact_force}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-eu_fact_force}
POSTGRES_DB: ${POSTGRES_DB:-eu_fact_force}
ports:
- 5432
volumes:
- postgres_data:/var/lib/postgresql
- ./docker/postgres/init:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-eu_fact_force} -d ${POSTGRES_DB:-eu_fact_force}"]
interval: 5s
timeout: 5s
retries: 5
# MinIO: S3-compatible object storage with web console.
# Console UI: http://localhost:9001 | S3 API: http://localhost:9000
minio:
image: minio/minio:latest
restart: unless-stopped
ports:
- 9000
- 9001
environment:
MINIO_ROOT_USER: ${AWS_ACCESS_KEY_ID:-minioadmin}
MINIO_ROOT_PASSWORD: ${AWS_SECRET_ACCESS_KEY:-minioadmin}
command: server /data --console-address ":9001"
volumes:
- minio_data:/data
healthcheck:
test: ["CMD-SHELL", "mc ready local || curl -f http://localhost:9000/minio/health/live || exit 1"]
interval: 5s
timeout: 5s
retries: 10
start_period: 15s
# Create default S3 bucket on first run (depends on MinIO).
minio-init:
image: amazon/aws-cli:latest
restart: "no"
depends_on:
minio:
condition: service_healthy
entrypoint: ["/bin/sh", "-c"]
command:
- |
aws s3 mb s3://$${AWS_STORAGE_BUCKET_NAME} --endpoint-url http://minio:9000 2>/dev/null || true
echo "Bucket ready."
environment:
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID:-minioadmin}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY:-minioadmin}
AWS_STORAGE_BUCKET_NAME: ${AWS_STORAGE_BUCKET_NAME:-eu-fact-force-files}
volumes:
postgres_data:
minio_data:
hf_cache: