/dev/tcp is bash-only and fails in the container's default sh. Switch to a real HTTP check against the OSRM API root, and add a 30s start_period so Docker doesn't fail the check before the road data finishes loading. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
34 lines
775 B
YAML
34 lines
775 B
YAML
services:
|
|
osrm:
|
|
image: osrm/osrm-backend
|
|
container_name: osrm
|
|
restart: unless-stopped
|
|
ports:
|
|
- "5002:5000"
|
|
volumes:
|
|
- ./docker/osrm/data:/data
|
|
command: osrm-routed --algorithm mld /data/connecticut-latest.osrm
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -sf http://localhost:5000/ || exit 1"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
|
|
balloons-shop:
|
|
build: .
|
|
container_name: balloons-shop
|
|
ports:
|
|
- "3000:3000"
|
|
env_file:
|
|
- .env
|
|
restart: unless-stopped
|
|
depends_on:
|
|
osrm:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:3000/api/catalog"]
|
|
interval: 30s
|
|
timeout: 10s
|
|
retries: 3
|