Files
reitti/docker-compose-dev.yml

112 lines
2.8 KiB
YAML

services:
postgis:
image: postgis/postgis:17-3.5-alpine
environment:
POSTGRES_USER: reitti
POSTGRES_PASSWORD: reitti
POSTGRES_DB: reittidb
ports:
- "5432:5432"
volumes:
- postgis-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U reitti -d reittidb"]
interval: 10s
timeout: 5s
retries: 5
rabbitmq:
image: rabbitmq:3-management-alpine
ports:
- "5672:5672" # AMQP protocol port
- "15672:15672" # Management UI port
- "1883:1883" #MQTT port
post_start:
- command: rabbitmq-plugins enable rabbitmq_mqtt
user: root
environment:
RABBITMQ_DEFAULT_USER: reitti
RABBITMQ_DEFAULT_PASS: reitti
volumes:
- rabbitmq-data:/var/lib/rabbitmq
healthcheck:
test: ["CMD", "rabbitmq-diagnostics", "check_port_connectivity"]
interval: 30s
timeout: 10s
retries: 5
redis:
image: redis:7-alpine
ports:
- "6379:6379"
volumes:
- redis-data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
photon:
image: rtuszik/photon-docker:1.2.1
environment:
- UPDATE_STRATEGY=PARALLEL
- REGION=de
ports:
- "2322:2322"
volumes:
- photon-data:/photon/data
ot-recorder:
image: owntracks/recorder:latest
depends_on:
rabbitmq:
condition: service_healthy
environment:
- OTR_HOST=rabbitmq
- OTR_USER=reitti
- OTR_PASS=reitti
ports:
- "8083:8083"
volumes:
- ot-recorder-data:/store
tile-cache:
image: nginx:alpine
environment:
NGINX_CACHE_SIZE: 1g
ports:
- "8084:80"
command: |
sh -c "
mkdir -p /var/cache/nginx/tiles
cat > /etc/nginx/nginx.conf << 'EOF'
events {
worker_connections 1024;
}
http {
proxy_cache_path /var/cache/nginx/tiles levels=1:2 keys_zone=tiles:10m max_size=1g inactive=30d use_temp_path=off;
server {
listen 80;
location / {
proxy_pass https://tile.openstreetmap.org/;
proxy_set_header Host tile.openstreetmap.org;
proxy_set_header User-Agent \"Reitti/1.0 \\(+https://github.com/dedicatedcode/reitti; contact: reitti@dedicatedcode.com\\)\";
proxy_cache tiles;
proxy_cache_valid 200 30d;
proxy_cache_use_stale error timeout updating http_500 http_502 http_503 http_504;
}
}
}
EOF
nginx -g 'daemon off;'"
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://127.0.0.1/0/0/0.png"]
interval: 30s
timeout: 10s
retries: 3
volumes:
postgis-data:
redis-data:
rabbitmq-data:
photon-data:
ot-recorder-data: