feat(owncloud): add ownCloud with MariaDB and Redis

This commit is contained in:
tiennm99 committed 2026-10-05 10:49:47 +07:00
1 parent 0b660eb106
commit 7616ff9f89
4 files changed
+141

No files matched your search

+1
View File
@@ -85,6 +85,7 @@ Each links to its own README for variables, ports, and storage.
| [litellm](litellm/README.md) | LiteLLM proxy in front of many LLM providers, with PostgreSQL and Redis |
| [open-webui](open-webui/README.md) | Open WebUI chat interface for OpenAI-compatible and Ollama providers |
| [opencode](opencode/README.md) | opencode coding agent, served as a browser UI |
| [owncloud](owncloud/README.md) | ownCloud file sync and share, with MariaDB and Redis |
| [paseo](paseo/README.md) | Paseo coding-agent daemon and web UI |
| [traffmonetizer](traffmonetizer/README.md) | TraffMonetizer bandwidth-sharing client |
| [webtop](webtop/README.md) | Ubuntu XFCE desktop in the browser |
+17
View File
@@ -0,0 +1,17 @@
# Copy to .env and fill in. Never commit .env.
#
# cp .env.example .env
# Public hostname, without scheme. Also the only trusted domain.
OWNCLOUD_DOMAIN=owncloud.example.com
# Admin account, created on first start only.
# Generate a password with: openssl rand -base64 24
OWNCLOUD_ADMIN_USERNAME=admin
OWNCLOUD_ADMIN_PASSWORD=
# MariaDB credentials, used by the database and by ownCloud.
DB_NAME=owncloud
DB_USER=owncloud
DB_PASSWORD=
DB_ROOT_PASSWORD=
+57
View File
@@ -0,0 +1,57 @@
# owncloud
[ownCloud](https://doc.owncloud.com/server/10.16/admin_manual/installation/docker/)
Server: file sync and share, with web, desktop and mobile clients.
Three containers: `owncloud`, `mariadb` for metadata, users and shares, and
`redis` for file locking and the distributed cache.
## Setup
1. Set `OWNCLOUD_DOMAIN`, `OWNCLOUD_ADMIN_PASSWORD`, `DB_PASSWORD` and
`DB_ROOT_PASSWORD`.
2. Map the domain to port `8080` and deploy. The first start installs
ownCloud and creates the admin account.
3. Log in with `OWNCLOUD_ADMIN_USERNAME` / `OWNCLOUD_ADMIN_PASSWORD`.
Health check: `/usr/bin/healthcheck`, the image's own script, also the compose
healthcheck.
## Environment
| Variable | Default | Purpose |
| --- | --- | --- |
| `OWNCLOUD_DOMAIN` | — | Public hostname, without scheme |
| `OWNCLOUD_ADMIN_USERNAME` / `OWNCLOUD_ADMIN_PASSWORD` | `admin` / — | Admin account |
| `DB_NAME` / `DB_USER` / `DB_PASSWORD` | `owncloud` / `owncloud` / — | Database credentials, read by both containers |
| `DB_ROOT_PASSWORD` | — | MariaDB root password |
`OWNCLOUD_DOMAIN` also fills `OWNCLOUD_TRUSTED_DOMAINS`; ownCloud rejects
requests for any host not on that list.
The admin variables are read only by the first-start install. Changing them
later does not change the account; use the web UI or `occ user:resetpassword`.
The database credentials are stored inside the MariaDB data directory when it
is first created. Changing them in the environment afterwards breaks the
connection rather than changing the password.
## Storage
| Volume | Mount | Holds |
| --- | --- | --- |
| `owncloud-data` | `/mnt/data` | User files, apps, `config.php` |
| `owncloud-mysql-data` | `/var/lib/mysql` | The database |
Redis has no named volume. It holds only locks and cache, which ownCloud
rebuilds after a restart.
## Images
`owncloud/server:10` tracks the 10.x line. `latest` points at the same
release today, but ownCloud now also publishes 11.x, and a move to a new major
should be a deliberate upgrade with a backup, not a side effect of a pull.
`mariadb:12` and `redis:6` track their major versions. A MariaDB data
directory cannot move back to an older major, so back up the database volume
before changing it.
+66
View File
@@ -0,0 +1,66 @@
services:
owncloud:
image: owncloud/server:10
restart: unless-stopped
environment:
- OWNCLOUD_DOMAIN=${OWNCLOUD_DOMAIN:?required}
- OWNCLOUD_TRUSTED_DOMAINS=${OWNCLOUD_DOMAIN:?required}
- OWNCLOUD_ADMIN_USERNAME=${OWNCLOUD_ADMIN_USERNAME:-admin}
- OWNCLOUD_ADMIN_PASSWORD=${OWNCLOUD_ADMIN_PASSWORD:?required}
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_HOST=mariadb
- OWNCLOUD_DB_NAME=${DB_NAME:-owncloud}
- OWNCLOUD_DB_USERNAME=${DB_USER:-owncloud}
- OWNCLOUD_DB_PASSWORD=${DB_PASSWORD:?required}
- OWNCLOUD_MYSQL_UTF8MB4=true
- OWNCLOUD_REDIS_ENABLED=true
- OWNCLOUD_REDIS_HOST=redis
volumes:
- owncloud-data:/mnt/data
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "/usr/bin/healthcheck"]
interval: 30s
timeout: 10s
retries: 5
# MariaDB for file metadata, users and shares.
mariadb:
image: mariadb:12
restart: unless-stopped
command:
- --character-set-server=utf8mb4
- --collation-server=utf8mb4_bin
- --max-allowed-packet=128M
- --innodb-log-file-size=64M
environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASSWORD:?required}
- MYSQL_DATABASE=${DB_NAME:-owncloud}
- MYSQL_USER=${DB_USER:-owncloud}
- MYSQL_PASSWORD=${DB_PASSWORD:?required}
volumes:
- owncloud-mysql-data:/var/lib/mysql
healthcheck:
test: ["CMD", "healthcheck.sh", "--connect", "--innodb_initialized"]
interval: 5s
timeout: 20s
retries: 10
# Redis for file locking and the distributed cache.
redis:
image: redis:6
restart: unless-stopped
command: ["--databases", "1"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
owncloud-data:
owncloud-mysql-data: