version: '3'

networks:
  pharmaceutical_research: #because it helps to have a way to link specifically to this. 
    external: true

services:
  aact_db:
    image: postgres:14-alpine
    restart: "no"
    networks:
      - pharmaceutical_research
    container_name: aact_db
    #restart: always #restart after crashes
    environment:
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
      POSTGRES_DB: ${POSTGRES_DB}
      VERSION: podman
    ports:
      - "5432:5432" #host:container
    volumes: #host:container is the format.
      # this is persistant storage for the database  
      - ./AACT_downloader/postgresql/:/var/lib/postgresql/
      # this is the database dump to restore from
      - ./AACT_downloader/aact_downloads/postgres_data.dmp:/mnt/host_data/postgres_data.dmp
      # this is the folder containing entrypoint info.
      - ./AACT_downloader/docker-entrypoint-initdb.d/:/docker-entrypoint-initdb.d/
    shm_size: 512mb


  rxnav-db:
    image: mariadb:10.4
    restart: "no"
    ports:
      - "3306:3306"
    volumes:
      - ./RxNav-In-a-box/rxnav-in-a-box-20230103/mysql:/docker-entrypoint-initdb.d:ro
      - ./RxNav-In-a-box/rxnav_data:/var/lib/mysql
    environment:
      MYSQL_RANDOM_ROOT_PASSWORD: "yes"
      MYSQL_USER: ${MYSQL_USER}
      MYSQL_PASSWORD: ${MYSQL_PASSWORD}
      VERSION: podman
    env_file:
      .env
    networks:
      - pharmaceutical_research
