docker-compose.yml•875 B
version: "3.8"
services:
weather-server:
build: .
ports:
- "3000:3000"
environment:
- WEATHER_API_KEY=${WEATHER_API_KEY}
- DEFAULT_LOCATION=${DEFAULT_LOCATION:-London}
- TEMP_UNIT=${TEMP_UNIT:-C}
- NODE_ENV=production
volumes:
- weather-data:/app/data
restart: unless-stopped
healthcheck:
test:
[
"CMD",
"node",
"-e",
"require('http').get('http://localhost:3000/api/health', (res) => { process.exit(res.statusCode === 200 ? 0 : 1) })",
]
interval: 30s
timeout: 10s
retries: 3
start_period: 10s
nginx:
image: nginx:alpine
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
depends_on:
- weather-server
restart: unless-stopped
volumes:
weather-data: