version: '3.8'

services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: quailmanager-app
    restart: always
    ports:
      - "3001:3000"
    environment:
      - DATABASE_URL=postgresql://quail:quailpass@db:5432/quaildb
      - NODE_ENV=production
    depends_on:
      - db
    networks:
      - quail-network

  db:
    image: postgres:16-alpine
    container_name: quailmanager-db
    restart: always
    environment:
      POSTGRES_USER: quail
      POSTGRES_PASSWORD: quailpass
      POSTGRES_DB: quaildb
    ports:
      - "5433:5432"
    volumes:
      - pgdata:/var/lib/postgresql/data
    networks:
      - quail-network

volumes:
  pgdata:

networks:
  quail-network:
    driver: bridge
