version: '3.7'

services:
  aktienbot_fe:
    image: registry.flokaiser.com/aktienbot/frontend
    labels:
      traefik.enable: 'true'
      traefik.http.routers.aktienbot_fe.rule: Host(`gruppe1.testsites.info`) && !PathPrefix(`/api`) && !PathPrefix(`/phpmyadmin`) && !PathPrefix(`/portainer`)
      traefik.http.routers.aktienbot_fe.middlewares: secHeaders@file
      traefik.http.routers.aktienbot_fe.priority: 40
      traefik.http.routers.aktienbot_fe.tls: true
      traefik.http.routers.aktienbot_fe.tls.certresolver: myresolver

  aktienbot_api:
    image: registry.flokaiser.com/aktienbot/api
    labels:
      traefik.enable: 'true'
      traefik.http.routers.aktienbot_api.rule: Host(`gruppe1.testsites.info`) && PathPrefix(`/api`)
      traefik.http.routers.aktienbot_api.middlewares: secHeaders@file
      traefik.http.routers.aktienbot_api.priority: 50
      traefik.http.routers.aktienbot_api.tls: true
      traefik.http.routers.aktienbot_api.tls.certresolver: myresolver
    depends_on:
      - mariadb
    env_file:
      - ${PWD}/.env.api

  aktienbot_bot:
    image: registry.flokaiser.com/aktienbot/bot
    env_file:
      - ${PWD}/.env.bot

  mariadb:
    image: mariadb
    volumes:
      - mariadb_data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=sBvKtMY7ej9*dETatTtk#uRd5f*5wJYovfdDJDa&

  phpmyadmin:
    image: phpmyadmin
    environment:
      - PMA_HOST=mariadb
      - PMA_ABSOLUTE_URI=https://gruppe1.testsites.info/phpmyadmin/
    labels:
      traefik.enable: true
      traefik.http.routers.phpmyadmin.rule: Host(`gruppe1.testsites.info`) && PathPrefix(`/phpmyadmin`)
      traefik.http.routers.phpmyadmin.middlewares: secHeaders@file,strip_phpmyadmin
      traefik.http.routers.phpmyadmin.priority: 50
      traefik.http.routers.phpmyadmin.tls: true
      traefik.http.routers.phpmyadmin.tls.certresolver: myresolver

      traefik.http.middlewares.strip_phpmyadmin.stripprefix.prefixes: /phpmyadmin

networks:
  default:
    external:
      name: net

volumes:
  portainer_data:
  mariadb_data:
