# documentation: https://docs.vvveb.com
# slogan: Powerful and easy to use cms to build websites, blogs or ecommerce stores.
# tags: cms, blog, content, management, ecommerce, page-builder, nocode, mysql, sqlite, pgsql
# logo: svgs/vvveb.svg
# port: 80

services:
  vvveb:
    image: vvveb/vvvebcms:latest
    volumes:
      - vvveb-data:/var/www/html
    environment:
      - SERVICE_FQDN_VVVEB_80
      - DB_ENGINE=mysqli
      - DB_HOST=mariadb
      - DB_USER=${SERVICE_USER_VVVEB}
      - DB_PASSWORD=${SERVICE_PASSWORD_VVVEB}
      - DB_NAME=${MARIADB_DATABASE:-vvveb}
    depends_on:
      mariadb:
        condition: service_healthy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://127.0.0.1"]
      interval: 2s
      timeout: 10s
      retries: 10

  mariadb:
    image: mariadb:11
    volumes:
      - vvveb-mariadb-data:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=${SERVICE_PASSWORD_ROOT}
      - MYSQL_DATABASE=${MARIADB_DATABASE:-vvveb}
      - MYSQL_USER=${SERVICE_USER_VVVEB}
      - MYSQL_PASSWORD=${SERVICE_PASSWORD_VVVEB}
    healthcheck:
      test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
      interval: 5s
      timeout: 20s
      retries: 10
