-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
44 lines (43 loc) · 1.25 KB
/
docker-compose.yml
File metadata and controls
44 lines (43 loc) · 1.25 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
services:
backend:
build:
context: ./weather-backend
dockerfile: Dockerfile
env_file:
# Optional: ports / build args from repo-root .env (do not put an empty WEATHER_API_KEY here).
- path: .env
required: false
# API key and backend options (same file as local `python run.py`).
- path: ./weather-backend/.env
required: false
ports:
- "${BACKEND_PORT:-5000}:5000"
environment:
WEATHER_CACHE_TTL: ${WEATHER_CACHE_TTL:-300}
CORS_ORIGINS: ${CORS_ORIGINS:-}
RATE_LIMIT_WEATHER: ${RATE_LIMIT_WEATHER:-60 per minute}
LOG_LEVEL: ${LOG_LEVEL:-INFO}
SECRET_KEY: ${SECRET_KEY:-}
healthcheck:
test:
[
"CMD-SHELL",
"python -c \"import urllib.request; urllib.request.urlopen('http://127.0.0.1:5000/api/health')\"",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 15s
restart: unless-stopped
frontend:
build:
context: ./weather-frontend
dockerfile: Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://127.0.0.1:5000/api}
ports:
- "${FRONTEND_PORT:-8080}:80"
depends_on:
backend:
condition: service_healthy
restart: unless-stopped