version: '3.8' services: postgres: image: postgres:16-alpine container_name: postgres environment: POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres POSTGRES_DB: myapp ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data restart: unless-stopped redis: image: redis:7-alpine container_name: redis ports: - "6379:6379" volumes: - redis_data:/data restart: unless-stopped volumes: postgres_data: redis_data: