version: '3.8' services: db: image: postgres:16-alpine container_name: postgres-db restart: always environment: POSTGRES_DB: my_db POSTGRES_USER: user POSTGRES_PASSWORD: password # รหัสผ่านสำหรับช่วงพัฒนาเท่านั้น ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data # Healthcheck เพื่อให้ backend รอจนกว่า DB จะพร้อม healthcheck: test: ["CMD-SHELL", "pg_isready -U user -d my_db"] interval: 5s timeout: 5s retries: 5 volumes: postgres_data: minio_data: