services:
  mariadb:
    image: mariadb:10.11
    container_name: ptero-db
    restart: unless-stopped
    environment:
      MYSQL_DATABASE: panel
      MYSQL_USER: pterodactyl
      MYSQL_PASSWORD: pass
      MYSQL_ROOT_PASSWORD: pass
    volumes:
      - ptero_db_data:/var/lib/mysql
    networks: [ptero]

  redis:
    image: redis:7-alpine
    container_name: ptero-redis
    restart: unless-stopped
    volumes:
      - ptero_redis_data:/data
    networks: [ptero]

  panel:
    image: ghcr.io/pterodactyl/panel:latest
    container_name: ptero-panel
    restart: unless-stopped
    depends_on: [mariadb, redis]
    environment:
      APP_ENV: production
      APP_URL: https://panel.wimps.win
      APP_TIMEZONE: America/Chicago
      DB_CONNECTION: mysql
      DB_HOST: mariadb
      DB_PORT: 3306
      DB_DATABASE: panel
      DB_USERNAME: pterodactyl
      DB_PASSWORD: pass
      CACHE_DRIVER: redis
      SESSION_DRIVER: redis
      QUEUE_CONNECTION: redis
      REDIS_HOST: redis
      REDIS_PORT: 6379
      CF-Access-Client-Id: 058ff97bd38056df0d79525ef229bd3c.access
      CF-Access-Client-Secret: e33bf110c292368a669c102a4f2cbc95572b6c7adedb0de5b28c680ecadabd68
    volumes:
      - ptero_panel_var:/app/var
      - ptero_panel_storage:/app/storage
    # Required so host cloudflared can reach it
    ports:
      - "127.0.0.1:8080:80"
    networks: [ptero]

  fileserver:
    image: nginx:alpine
    container_name: ptero-fileserver
    volumes:
      - /srv/ptero/nginx.conf:/etc/nginx/conf.d/default.conf:ro
      - /srv/ptero:/usr/share/nginx/html:ro
      - /srv/black-tongue:/usr/share/nginx/black-tongue:ro
    ports:
      - "8010:80"
    restart: unless-stopped
    networks: [ptero]
networks:
  ptero:

volumes:
  ptero_db_data:
    external: true
  ptero_redis_data:
    external: true
  ptero_panel_var:
    external: true
  ptero_panel_storage:
    external: true
