services:
  app:
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - 3000:3000
    volumes:
      - ..:/workspace:cached
    command: sleep infinity
    depends_on:
      - db

  db:
    image: postgres:18
    volumes:
      - postgres-data:/var/lib/postgresql
    env_file:
      - ../.env
    ports:
      - 5432:5432
    environment:
      TZ: Europe/Madrid
      POSTGRES_USER: ${POSTGRES_USER:-postgres}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-postgres}
      POSTGRES_DB: ${POSTGRES_DB:-postgres}

volumes:
  postgres-data:
