version: '3.8'

services:
  postgres:
    image: postgres:latest
    environment:
      POSTGRES_DB: granvoldat
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: postgres
    ports:
      - "5432:5432"
    volumes:
      - postgres-data:/var/lib/postgresql/data
    networks:
      - app-network

  mongo:
    image: mongo:latest
    environment:
      MONGO_INITDB_ROOT_USERNAME: mongodb
      MONGO_INITDB_ROOT_PASSWORD: mongodb
    ports:
      - "27017:27017"
    volumes:
      - mongo-data:/data/db
    networks:
      - app-network

  pgadmin:
    image: dpage/pgadmin4:latest
    environment:
      PGADMIN_DEFAULT_EMAIL: "eduardo.perez.hunich@fing.edu.uy"
      PGADMIN_DEFAULT_PASSWORD: "admin"
    ports:
      - "5050:80"
    depends_on:
      - postgres
    volumes:
      - pgadmin-data:/var/lib/pgadmin
    networks:
      - app-network

volumes:
  postgres-data:
  mongo-data:
  pgadmin-data:

networks:
  app-network:
    driver: bridge

