services:
  app:
    image: hykilpikonna/aquadx:latest
    ports:
      - "80:80"
      - "8443:8443"
      - "22345:22345"
    restart: on-failure:3
    environment:
      - SPRING_DATASOURCE_URL=jdbc:mariadb://db:3306/main
      - SPRING_DATASOURCE_USERNAME=cat
      - SPRING_DATASOURCE_PASSWORD=meow
      - SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.mariadb.jdbc.Driver
    depends_on:
      - db
    volumes:
      - ./config:/app/config
      - ./data:/app/data
  db:
    image: mariadb:latest
    environment:
      MYSQL_ROOT_PASSWORD: meow
      MYSQL_DATABASE: main
      MYSQL_USER: cat
      MYSQL_PASSWORD: meow
    ports:
      - "${AQUADX_DB_PORT:-127.0.0.1:3369}:3306"
    volumes:
      - "${AQUADX_DB_DATA:-mariadb_data}:/var/lib/mysql"

volumes:
  mariadb_data:
