version: "3.8" services: postgres: image: postgres:15-alpine container_name: spotify_le_2_postgres environment: POSTGRES_USER: ${POSTGRES_USER:-spotify} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-spotify_password} POSTGRES_DB: ${POSTGRES_DB:-spotify_le_2} ports: - "${POSTGRES_PORT:-5432}:5432" volumes: - postgres_data:/var/lib/postgresql/data restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-spotify}"] interval: 10s timeout: 5s retries: 5 networks: - spotify_network redis: image: redis:7-alpine container_name: spotify_le_2_redis command: redis-server --appendonly yes ports: - "${REDIS_PORT:-6379}:6379" volumes: - redis_data:/data restart: unless-stopped healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 networks: - spotify_network # Optional: Adminer for database management # Uncomment if you want a web-based database admin interface # adminer: # image: adminer:latest # container_name: spotify_le_2_adminer # ports: # - "8080:8080" # depends_on: # postgres: # condition: service_healthy # networks: # - spotify_network volumes: postgres_data: driver: local redis_data: driver: local networks: spotify_network: driver: bridge