Files
homelabstack/stacks/owncloud/docker-compose.yml
T
ginnoir 7aa95fa00a refactor: pure env_file stack.env convention across all stacks
Every service now reads stack.env via env_file with container-exact var
names — no ${VAR} parse-time interpolation, no Portainer UI env vars
(except stacks/dev, kept on UI-env interpolation as documented exception).

- media: drop PUID/PGID/TZ env lines (env_file covers); resolve ${ROOT}
- foundry: secrets via env_file; FOUNDRY_PATCH_URLS -> CONTAINER_PATCH_URLS
- monitoring: HOMARR_SECRET_ENCRYPTION_KEY -> SECRET_ENCRYPTION_KEY
- notify: FRESHRSS_USER composed in stack.env; TZ via env_file
- owncloud: container-exact OWNCLOUD_*/MYSQL_* keys; runtime $$ healthcheck
- resume/famapp: composites (DATABASE_URL etc.) written out in stack.env
- authentik: container-exact keys; image tag pinned in compose
- notes: couchdb creds via env_file
- remote: gains stack.env (no secrets; convention completeness)
- CLAUDE.md: env convention, valhalla-lab registration-only note, correct
  on-host Portainer working-copy path (/config/portainer/compose/<id>)

Validated with docker compose config on valhalla for all 15 stacks.
2026-06-09 16:03:47 -05:00

79 lines
2.1 KiB
YAML

# 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
env_file:
- stack.env
environment:
- OWNCLOUD_DB_TYPE=mysql
- OWNCLOUD_DB_NAME=owncloud
- OWNCLOUD_DB_HOST=mariadb
- 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]
env_file:
- stack.env
environment:
- MYSQL_DATABASE=owncloud
command: ["--max-allowed-packet=128M", "--innodb-log-file-size=64M"]
healthcheck:
# $$ defers expansion to container runtime (env_file supplies the value)
test: ["CMD-SHELL", "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