services:
  discord-app:
    image: manticorum67/paper-dynasty-discordapp:dev
    restart: unless-stopped
    volumes:
      - ./dev-storage:/usr/src/app/storage
      - ./dev-logs:/usr/src/app/logs
    environment:
      - PYTHONBUFFERED=0
      - GUILD_ID=669356687294988350
      - BOT_TOKEN=${BOT_TOKEN}
      - LOG_LEVEL=INFO
      - API_TOKEN=${API_TOKEN}
      - SCOREBOARD_CHANNEL=1000521215703789609
      - TZ=America/Chicago
      - PYTHONHASHSEED=1749583062
      - DATABASE=Dev
      - DB_USERNAME=postgres
      - DB_PASSWORD=${DB_PASSWORD}
      - DB_URL=db
      - DB_NAME=postgres
    depends_on:
      db:
        condition: service_healthy
  
  db:
    image: postgres
    restart: unless-stopped
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
    volumes:
      - pd_postgres:/var/lib/postgresql/data 
    healthcheck:
      test: ["CMD-SHELL", "pg_isready"]
      interval: 1s
      timeout: 5s
      retries: 5
      # start_period: 30s 

  adminer:
    image: adminer
    restart: always
    ports:
      - 8008:8080


networks:
  backend:
    driver: bridge

volumes:
  pd_postgres: