services:
  db:
    image: postgres:14
    container_name: timetracker_db
    restart: always
    ports:
      - "5432:5432"
    environment:
      POSTGRES_USER: timetracker
      POSTGRES_PASSWORD: password
      POSTGRES_DB: timetracker
    volumes:
      - db_data:/var/lib/postgresql/data
  pgadmin:
    image: dpage/pgadmin4
    container_name: pgadmin
    environment:
      PGADMIN_DEFAULT_EMAIL: admin@example.com
      PGADMIN_DEFAULT_PASSWORD: admin
    ports:
      - "8081:80"
    depends_on:
      - db

volumes:
  db_data:
