version: "3.9"

services:
  user-data-database:
    image: postgres:latest
    container_name: user-data-database
    restart: always
    networks:
      - user-data
    volumes:
      - user-data-database:/var/lib/postgresql
    env_file:
      - ./database.env
  user-data-database-admin:
    container_name: user-data-database-admin
    image: bitnami/phppgadmin:latest
    restart: always
    networks:
      - user-data
    depends_on:
      - user-data-database
    environment:
      - DATABASE_HOST=user-data-database
    ports:
      - "8083:8080"

networks:
  user-data:
    name: user-data
    driver: bridge

volumes:
  user-data-database:
    driver: local
