Files
homelab-docker/geo tracking/traccar/docker-compose.yml

48 lines
1.1 KiB
YAML

services:
database:
image: timescale/timescaledb:latest-pg16
restart: unless-stopped
environment:
POSTGRES_DB: traccar
POSTGRES_USER: traccar
POSTGRES_PASSWORD: traccar
TIMESCALEDB_TELEMETRY: "off"
volumes:
- data:/var/lib/postgresql/data
traccar:
image: traccar/traccar:latest
restart: unless-stopped
depends_on:
- database
environment:
CONFIG_USE_ENVIRONMENT_VARIABLES: "true"
DATABASE_DRIVER: org.postgresql.Driver
DATABASE_URL: jdbc:postgresql://database:5432/traccar
DATABASE_USER: traccar
DATABASE_PASSWORD: traccar
healthcheck:
test: [ "CMD", "wget", "-q", "--spider", "http://localhost:8082/api/health" ]
interval: 2m
timeout: 5s
start_period: 1h
retries: 3
ports:
- "8082:8082"
- "5144:5144"
volumes:
- logs:/opt/traccar/logs
autoheal:
image: willfarrell/autoheal:latest
restart: always
environment:
AUTOHEAL_CONTAINER_LABEL: all
AUTOHEAL_INTERVAL: 60
AUTOHEAL_START_PERIOD: 3600
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
volumes:
data:
logs: