-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.example.yaml
112 lines (104 loc) · 3.33 KB
/
docker-compose.example.yaml
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
name: flan
networks:
flan:
driver: bridge
services:
traefik:
image: traefik:v2.11@sha256:7c1cb803a546e3c94a2a71e26d35d8b4f24e844acbfc0b0d0e10b9938e8427dd
container_name: flan_traefik
command:
- "--api.insecure=false" # Disable the API/Dashboard for security
- "--providers.docker=true" # Enable Docker provider
- "--providers.docker.exposedbydefault=false" # Containers must opt-in to be exposed
# - "--log.level=DEBUG" # Uncomment for debug logging
# - "--accesslog=true" # Uncomment to enable access logs
- "--entrypoints.web.address=:80" # Define web entrypoint on port 80
ports:
- "4112:80" # Map host port 4112 to container port 80
# - "6969:8080" # Uncomment to expose dashboard
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro # Mount Docker socket read-only
networks:
- flan
frontend:
networks:
- flan
container_name: flan_frontend
build:
context: ./frontend
dockerfile: Dockerfile
labels:
- "traefik.enable=true"
- "traefik.http.routers.frontend.rule=PathPrefix(`/`) && !PathPrefix(`/api`) && !PathPrefix(`/images`)"
- "traefik.http.routers.frontend.entrypoints=web"
- "traefik.http.services.frontend.loadbalancer.server.port=4173"
- "traefik.http.routers.frontend.priority=1"
depends_on:
- backend
backend:
networks:
- flan
container_name: flan_backend
build: .
volumes:
- ./docker/config.toml:/config.toml:ro # Mount config file read-only
environment:
- RUST_LOG=debug # Set logging level
labels:
- "traefik.enable=true"
- "traefik.http.routers.backend.rule=PathPrefix(`/api`) || PathPrefix(`/images`)"
- "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.routers.backend.priority=10"
- "traefik.http.services.backend.loadbalancer.server.port=8080"
depends_on:
- postgres
- minio
- valkey
minio:
networks:
- flan
image: quay.io/minio/minio
container_name: flan_minio
command: server /data --console-address ":9001"
environment:
- MINIO_ROOT_USER=admin # Replace with your MinIO username
- MINIO_ROOT_PASSWORD=change-me-123 # Replace with a secure password
volumes:
- minio_data:/data # Persistent storage for MinIO
ports:
- 9000:9000 # API port
- 9001:9001 # Console port
postgres:
container_name: flan_postgres
networks:
- flan
image: postgres:15-alpine
ports:
- "6500:5432"
environment:
- POSTGRES_USER=app_user # Replace with your database username
- POSTGRES_PASSWORD=change-me-123 # Replace with a secure password
- POSTGRES_DB=db
restart: always
volumes:
- "postgres_data:/var/lib/postgresql/data" # Persistent storage for PostgreSQL
logging:
options:
max-size: "20m" # Limit log file size
max-file: "3" # Keep 3 rotated log files
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 60s
retries: 5
start_period: 80s
valkey:
image: valkey/valkey:8.0.2@sha256:e6a5b8e3e537cff12844c9be87d5f5e3c27e55c86833e92447e0bf33ce735ead
networks:
- flan
container_name: flan_valkey
ports:
- 6189:6379
volumes:
minio_data:
postgres_data: