-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose__repo_git_config.yml
More file actions
215 lines (207 loc) · 8.34 KB
/
docker-compose__repo_git_config.yml
File metadata and controls
215 lines (207 loc) · 8.34 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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
version: '3.8'
# ═══════════════════════════════════════════════════════════════
# DISSMODEL PLATFORM - Docker Compose (Phase 1 MVP)
# ═══════════════════════════════════════════════════════════════
services:
# ── NOVO: clona e mantém sincronizado o repo de configs ──────────────────
configs-sync:
image: alpine/git
container_name: dissmodel-configs-sync
restart: unless-stopped
volumes:
- configs-data:/configs
environment:
- CONFIGS_REPO=${CONFIGS_REPO:-https://github.com/lambdageo/dissmodel-configs}
- SYNC_INTERVAL=${CONFIGS_SYNC_INTERVAL:-900} # 15 min
entrypoint: |
sh -c '
if [ ! -d /configs/.git ]; then
git clone $$CONFIGS_REPO /configs
fi
while true; do
git -C /configs pull --ff-only
sleep $$SYNC_INTERVAL
done
'
networks:
- dissmodel-net
# ─────────────────────────────────────────────────────────────
# FRONTEND: JupyterLab Environment
# ─────────────────────────────────────────────────────────────
jupyter:
build:
context: ./services/frontend
dockerfile: Dockerfile
container_name: dissmodel-jupyter
restart: unless-stopped
ports:
- "${JUPYTER_PORT:-8888}:8888"
volumes:
- ./workspace:/home/jovyan/work
- ../dissmodel:/opt/dissmodel
- ./data/inputs:/data/inputs:ro
- ./data/outputs:/data/outputs
- ./examples:/examples:ro
command: >
bash -c "
pip show dissmodel || pip install -e /opt/dissmodel &&
start-notebook.sh --NotebookApp.token=''
"
environment:
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-minio:9000}
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER:-inpe_admin}
- MINIO_SECRET_KEY=${MINIO_ROOT_PASSWORD:-inpe_secret_2024}
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- API_ENDPOINT=http://api:8000
- DISSMODEL_CLOUD=${DISSMODEL_CLOUD:-false}
- JUPYTER_ENABLE_LAB=yes
env_file:
- .env
networks:
- dissmodel-net
#depends_on:
#minio:
# condition: service_healthy
#redis:
# condition: service_started
#healthcheck:
# test: ["CMD", "curl", "-f", "http://localhost:8888/api"]
# interval: 30s
# timeout: 10s
# retries: 3
# ─────────────────────────────────────────────────────────────
# BACKEND: API Gateway (FastAPI)
# ─────────────────────────────────────────────────────────────
api:
build:
context: ./services/api
dockerfile: Dockerfile
container_name: dissmodel-api
restart: unless-stopped
ports:
- "${API_PORT:-8000}:8000"
volumes:
- ./data/outputs:/data/outputs
environment:
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-minio:9000}
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER:-inpe_admin}
- MINIO_SECRET_KEY=${MINIO_ROOT_PASSWORD:-inpe_secret_2024}
- WORKER_QUEUE=${WORKER_QUEUE:-dissmodel_jobs}
- DISSMODEL_LOG_LEVEL=${DISSMODEL_LOG_LEVEL:-INFO}
- API_KEYS=${API_KEYS:-dev-key} # ← NOVO: autenticação
- CONFIGS_PATH=/configs
env_file:
- .env
networks:
- dissmodel-net
depends_on:
- redis
- minio
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3
# ─────────────────────────────────────────────────────────────
# BACKEND: Workers (Scalable)
# ─────────────────────────────────────────────────────────────
worker:
build:
context: ./services/worker
dockerfile: Dockerfile
restart: unless-stopped
volumes:
- ./data/inputs:/data/inputs:ro
- ./data/outputs:/data/outputs
- ../dissmodel:/opt/dissmodel
- configs-data:/configs:ro # ← NOVO: worker também lê configs
environment:
- REDIS_HOST=${REDIS_HOST:-redis}
- REDIS_PORT=${REDIS_PORT:-6379}
- MINIO_ENDPOINT=${MINIO_ENDPOINT:-minio:9000}
- MINIO_ACCESS_KEY=${MINIO_ROOT_USER:-inpe_admin}
- MINIO_SECRET_KEY=${MINIO_ROOT_PASSWORD:-inpe_secret_2024}
- WORKER_QUEUE=${WORKER_QUEUE:-dissmodel_jobs}
- WORKER_CONCURRENCY=${WORKER_CONCURRENCY:-4}
- DISSMODEL_LOG_LEVEL=${DISSMODEL_LOG_LEVEL:-INFO}
- SAL_ANIMATE=0
env_file:
- .env
networks:
- dissmodel-net
depends_on:
- redis
- minio
deploy:
replicas: 1
resources:
limits:
cpus: '2'
memory: 4G
reservations:
cpus: '1'
memory: 2G
# ─────────────────────────────────────────────────────────────
# INFRA: MinIO Storage (S3-compatible)
# ─────────────────────────────────────────────────────────────
minio:
image: minio/minio:RELEASE.2024-01-01T16-36-33Z
container_name: dissmodel-minio
restart: unless-stopped
ports:
- "19000:9000"
- "19001:9001"
command: server /data --console-address ":9001"
volumes:
- minio-data:/data
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-inpe_admin}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-inpe_secret_2024}
env_file:
- .env
networks:
- dissmodel-net
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
interval: 30s
timeout: 20s
retries: 3
# ─────────────────────────────────────────────────────────────
# INFRA: Redis Queue
# ─────────────────────────────────────────────────────────────
redis:
image: redis:7-alpine
container_name: dissmodel-redis
restart: unless-stopped
ports:
- "6379:6379"
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
- dissmodel-net
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
# ───────────────────────────────────────────────────────────────
# Networks
# ───────────────────────────────────────────────────────────────
networks:
dissmodel-net:
driver: bridge
name: dissmodel-network
# ───────────────────────────────────────────────────────────────
# Volumes (named)
# ───────────────────────────────────────────────────────────────
volumes:
minio-data:
name: dissmodel-minio-data
redis-data:
name: dissmodel-redis-data
configs-data: # ← NOVO: volume compartilhado
name: dissmodel-configs-data