version: '3.8'

services:
  postgres:
    image: postgres:16-alpine
    container_name: feuerwehr_db_dev
    environment:
      POSTGRES_DB: feuerwehr_dev
      POSTGRES_USER: dev_user
      POSTGRES_PASSWORD: dev_password
    ports:
      - "5432:5432"
    volumes:
      - postgres_data_dev:/var/lib/postgresql/data
      - ./backend/src/database/migrations:/docker-entrypoint-initdb.d:ro
    networks:
      - feuerwehr_dev_network
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U dev_user -d feuerwehr_dev"]
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 10s
    restart: unless-stopped

volumes:
  postgres_data_dev:
    driver: local

networks:
  feuerwehr_dev_network:
    driver: bridge
