# owncloud stack — ownCloud server + its dedicated MariaDB and Redis. # DB/cache stay co-located with the app so depends_on health-gating keeps working. # All data is bind-mounted already (/config/owncloud, /config/mysql, /config/redis). # Only the owncloud server joins `edge`; mariadb/redis stay private. services: owncloud: image: owncloud/server:latest container_name: owncloud_server restart: unless-stopped networks: [owncloud, edge] ports: - "8080:8080" depends_on: mariadb: condition: service_healthy redis: condition: service_healthy environment: - OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN} - OWNCLOUD_DB_TYPE=mysql - OWNCLOUD_DB_NAME=owncloud - OWNCLOUD_DB_USERNAME=${OWNCLOUD_DB_USER} - OWNCLOUD_DB_PASSWORD=${OWNCLOUD_DB_PASSWORD} - OWNCLOUD_DB_HOST=mariadb - OWNCLOUD_ADMIN_USERNAME=${OWNCLOUD_ADMIN_USER} - OWNCLOUD_ADMIN_PASSWORD=${OWNCLOUD_ADMIN_PASSWORD} - OWNCLOUD_MYSQL_UTF8MB4=true - OWNCLOUD_REDIS_ENABLED=true - OWNCLOUD_REDIS_HOST=redis healthcheck: test: ["CMD", "/usr/bin/healthcheck"] interval: 30s timeout: 10s retries: 5 volumes: - /config/owncloud:/mnt/data - /storage1/Books:/mnt/books - /mnt/dropbox:/mnt/data/files/dropbox - /storage1/ROMs:/mnt/roms mariadb: image: mariadb:latest container_name: owncloud_mariadb restart: unless-stopped networks: [owncloud] environment: - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD} - MYSQL_USER=${OWNCLOUD_DB_USER} - MYSQL_PASSWORD=${OWNCLOUD_DB_PASSWORD} - MYSQL_DATABASE=owncloud command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"] healthcheck: test: ["CMD", "mariadb-admin", "ping", "-u", "root", "--password=${MYSQL_ROOT_PASSWORD}"] interval: 10s timeout: 5s retries: 5 volumes: - /config/mysql:/var/lib/mysql redis: image: redis:latest container_name: owncloud_redis restart: unless-stopped networks: [owncloud] command: ["--databases", "1"] healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 volumes: - /config/redis:/data networks: owncloud: name: owncloud driver: bridge edge: name: edge external: true