services: redis: image: redis:8.8.1-alpine restart: unless-stopped command: - redis-server - --save - "" - --appendonly - "no" - --maxmemory - 256mb - --maxmemory-policy - allkeys-lru healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 5 api: build: . restart: unless-stopped env_file: - path: .env required: false environment: REDIS_URL: redis://redis:6379/0 depends_on: redis: condition: service_healthy ports: - "5302:5302" volumes: - ./data:/app/data healthcheck: test: [ "CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5302/health', timeout=3)", ] interval: 30s timeout: 5s retries: 3 start_period: 30s