-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
89 lines (86 loc) · 3.2 KB
/
docker-compose.yml
File metadata and controls
89 lines (86 loc) · 3.2 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
services:
app:
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://rustfs: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}
volumes:
- .:/app
depends_on:
postgres:
condition: service_healthy
rustfs-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
# 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
# RustFS: S3-compatible object storage with web console (Apache 2.0).
# Console UI: http://localhost:9001 | S3 API: http://localhost:9000
rustfs:
image: rustfs/rustfs:latest
restart: unless-stopped
ports:
- 9000
- 9001
environment:
RUSTFS_ACCESS_KEY: ${AWS_ACCESS_KEY_ID:-minioadmin}
RUSTFS_SECRET_KEY: ${AWS_SECRET_ACCESS_KEY:-minioadmin}
RUSTFS_CONSOLE_ENABLE: "true"
command: ["--console-enable", "/data"]
volumes:
- ./rustfs_data:/data
healthcheck:
test: ["CMD-SHELL", "wget --server-response -qO /dev/null http://localhost:9000/minio/health/live 2>&1 | grep -qE 'HTTP/1\\.[01] (200|403)'"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
# Create default S3 bucket on first run (depends on RustFS).
rustfs-init:
image: amazon/aws-cli:latest
depends_on:
rustfs:
condition: service_healthy
entrypoint: ["/bin/sh", "-c"]
command:
- |
aws s3 mb s3://$${AWS_STORAGE_BUCKET_NAME} --endpoint-url http://rustfs: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}