version: '3.7'

services:
  app_proxy:
    environment:
      APP_HOST: hortusfox_app_1
      APP_PORT: 80

  app:
    image: ghcr.io/danielbrendel/hortusfox-web:v5.7@sha256:8c286b6656920071c4c10142203566b5305702806117d01a66be6ba66d27a104
    restart: on-failure
    volumes:
      - ${APP_DATA_DIR}/data/images:/var/www/html/public/img
      - ${APP_DATA_DIR}/data/logs:/var/www/html/app/logs
      - ${APP_DATA_DIR}/data/backup:/var/www/html/public/backup
      - ${APP_DATA_DIR}/data/themes:/var/www/html/public/themes
      - ${APP_DATA_DIR}/data/migrate:/var/www/html/app/migrations
    environment:
      APP_ADMIN_EMAIL: "dfwebos@dfwebos.local"
      APP_ADMIN_PASSWORD: ${APP_PASSWORD}
      DB_HOST: hortusfox_db_1
      DB_PORT: 3306
      DB_DATABASE: hortusfox
      DB_USERNAME: user
      DB_PASSWORD: password
      DB_CHARSET: "utf8mb4"
    depends_on:
      - db

  db:
    image: mariadb:11.4.7@sha256:c5c82ddc074b9236fda87127934a1da726ecac68e9de083fd0e0d11a7bedc077
    restart: on-failure
    environment:
      MYSQL_ROOT_PASSWORD: my-secret-pw
      MYSQL_DATABASE: hortusfox
      MYSQL_USER: user
      MYSQL_PASSWORD: password
    volumes:
      - ${APP_DATA_DIR}/data/db_data:/var/lib/mysql
