-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
135 lines (127 loc) · 3.07 KB
/
docker-compose.yml
File metadata and controls
135 lines (127 loc) · 3.07 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# Copyright (c) 2025 CityLens Contributors
# Licensed under the MIT License
services:
# PostgreSQL với PostGIS
postgres:
image: postgis/postgis:15-3.4
container_name: citylens-postgres-prod
environment:
POSTGRES_USER: citylens
POSTGRES_PASSWORD: citylens_password
POSTGRES_DB: citylens_db
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
# Mount init scripts for auto database seeding
- ./backend/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:ro
networks:
- citylens-network-prod
healthcheck:
test: ["CMD-SHELL", "pg_isready -U citylens"]
interval: 10s
timeout: 5s
retries: 5
# MongoDB
mongodb:
image: mongo:7.0
container_name: citylens-mongodb-prod
environment:
MONGO_INITDB_DATABASE: citylens_realtime
ports:
- "27017:27017"
volumes:
- mongodb_data:/data/db
networks:
- citylens-network-prod
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.adminCommand('ping')"]
interval: 10s
timeout: 5s
retries: 5
# Redis
redis:
image: redis:7.2-alpine
container_name: citylens-redis-prod
ports:
- "6379:6379"
volumes:
- redis_data:/data
networks:
- citylens-network-prod
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# GraphDB (Apache Jena Fuseki)
graphdb:
image: stain/jena-fuseki:latest
container_name: citylens-graphdb-prod
environment:
ADMIN_PASSWORD: admin
ports:
- "7200:3030"
volumes:
- graphdb_data:/fuseki
networks:
- citylens-network-prod
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:3030/$/ping"]
interval: 30s
timeout: 10s
retries: 3
# Backend API
backend:
build:
context: ./backend
dockerfile: Dockerfile
container_name: citylens-backend-prod
env_file:
- ./backend/.env
environment:
- BACKEND_CORS_ORIGINS=["*"]
- POSTGRES_SERVER=postgres
- POSTGRES_USER=citylens
- POSTGRES_PASSWORD=citylens_password
- POSTGRES_DB=citylens_db
- POSTGRES_PORT=5432
- MONGODB_URL=mongodb://mongodb:27017
- REDIS_HOST=redis
- GRAPHDB_URL=http://graphdb:3030
ports:
- "8000:8000"
volumes:
- ./backend:/app
- backend_uploads:/app/uploads
depends_on:
postgres:
condition: service_healthy
mongodb:
condition: service_healthy
redis:
condition: service_healthy
networks:
- citylens-network-prod
command: uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
# Web Dashboard
web-dashboard:
build:
context: ./web-dashboard
dockerfile: Dockerfile
container_name: citylens-web-prod
ports:
- "3000:80"
depends_on:
- backend
networks:
- citylens-network-prod
volumes:
postgres_data:
mongodb_data:
redis_data:
graphdb_data:
backend_uploads:
networks:
citylens-network-prod:
driver: bridge