Files
docker-compose/nextcloud/docker-compose.yml
T

116 lines
4.1 KiB
YAML
Raw Normal View History

2025-07-10 16:05:52 +05:30
services:
nextcloud_db:
container_name: nextcloud_db
2025-07-13 18:35:45 +05:30
image: docker.io/library/postgres:17.5
restart: unless-stopped
2025-07-10 16:05:52 +05:30
environment:
2025-07-19 20:30:14 +05:30
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_DB=${POSTGRES_DB}
2025-07-10 16:05:52 +05:30
volumes:
2025-07-19 20:30:14 +05:30
- ${APPDATA_PATH}/nextcloud/db:/var/lib/postgresql/data
2025-07-10 16:05:52 +05:30
ports:
2025-07-19 20:30:14 +05:30
- ${DB_PORT}:5432
2025-07-20 22:08:40 +05:30
networks:
- backend
2025-07-10 16:05:52 +05:30
healthcheck:
test: ["CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}"]
2025-07-19 20:30:14 +05:30
interval: 10s
timeout: 5s
retries: 3
2025-07-20 15:53:26 +05:30
start_period: 10s
2025-07-10 16:05:52 +05:30
nextcloud_valkey:
container_name: nextcloud_valkey
2025-07-13 18:35:45 +05:30
image: docker.io/valkey/valkey:8.1.3
restart: unless-stopped
2025-07-19 20:30:14 +05:30
command: valkey-server --save 60 1 --requirepass ${VALKEY_PASSWORD}
2025-07-10 16:05:52 +05:30
volumes:
2025-07-19 20:30:14 +05:30
- ${APPDATA_PATH}/nextcloud/valkey:/data
2025-07-10 16:05:52 +05:30
ports:
2025-07-19 20:30:14 +05:30
- ${VALKEY_PORT}:6379
2025-07-20 22:08:40 +05:30
networks:
- backend
2025-07-10 16:05:52 +05:30
healthcheck:
test: ["CMD-SHELL", "echo 'auth ${VALKEY_PASSWORD}\nping' | valkey-cli | grep PONG"]
2025-07-20 15:53:26 +05:30
interval: 10s
timeout: 5s
retries: 3
start_period: 10s
2025-07-10 16:05:52 +05:30
nextcloud_app:
image: docker.io/library/nextcloud:31.0.7
2025-07-10 16:05:52 +05:30
container_name: nextcloud_app
2025-07-13 18:35:45 +05:30
restart: unless-stopped
2025-07-10 16:05:52 +05:30
depends_on:
nextcloud_db:
2025-07-19 20:30:14 +05:30
condition: service_healthy
2025-07-10 16:05:52 +05:30
nextcloud_valkey:
2025-07-19 20:30:14 +05:30
condition: service_healthy
2025-07-20 22:08:40 +05:30
labels:
- traefik.enable=true
- traefik.http.routers.nextcloud.rule=Host(`${TRAEFIK_DOMAIN}`)
2025-07-23 22:04:25 +05:30
- traefik.http.routers.nextcloud.entrypoints=websecure
2025-07-20 22:08:40 +05:30
- traefik.http.services.nextcloud.loadbalancer.server.port=80
2025-07-20 22:22:31 +05:30
- traefik.http.services.nextcloud.loadbalancer.passhostheader=true
- traefik.http.routers.nextcloud.middlewares=nextcloud-redirectregex1,nextcloud-redirectregex2,compresstraefik,nextcloud-securityheaders
- traefik.http.middlewares.compresstraefik.compress=true
- traefik.http.middlewares.nextcloud-redirectregex1.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex1.redirectregex.regex=https?://([^/]*)/.well-known/(card|cal)dav
- traefik.http.middlewares.nextcloud-redirectregex1.redirectregex.replacement=https://$${1}/remote.php/dav/
- traefik.http.middlewares.nextcloud-redirectregex2.redirectregex.permanent=true
- traefik.http.middlewares.nextcloud-redirectregex2.redirectregex.regex=https?://([^/]*)(/.well-known[^#]*)
- traefik.http.middlewares.nextcloud-redirectregex2.redirectregex.replacement=https://$${1}/index.php$${2}
- traefik.http.middlewares.nextcloud-securityheaders.headers.stsSeconds=15552000
- traefik.http.middlewares.nextcloud-securityheaders.headers.stsIncludeSubdomains=true
- traefik.http.middlewares.nextcloud-securityheaders.headers.stsPreload=true
2025-07-20 22:15:32 +05:30
- traefik.docker.network=frontend
2025-07-10 16:05:52 +05:30
environment:
2025-07-19 20:30:14 +05:30
- POSTGRES_HOST=nextcloud_db:5432
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- REDIS_HOST=nextcloud_valkey
- REDIS_HOST_PORT=6379
- REDIS_HOST_PASSWORD=${VALKEY_PASSWORD}
- PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}
- PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}
- APACHE_DISABLE_REWRITE_IP=${APACHE_DISABLE_REWRITE_IP}
2025-07-10 16:05:52 +05:30
volumes:
- ${APPDATA_PATH}/nextcloud/app:/var/www/html
ports:
- ${APP_PORT}:80
2025-07-20 22:08:40 +05:30
networks:
- frontend
- backend
2025-07-10 16:05:52 +05:30
2025-07-10 16:47:19 +05:30
nextcloud_cron:
image: docker.io/library/nextcloud:31.0.7
2025-07-10 16:47:19 +05:30
container_name: nextcloud_cron
2025-07-13 18:35:45 +05:30
restart: unless-stopped
2025-07-10 16:47:19 +05:30
depends_on:
- nextcloud_app
entrypoint: /cron.sh
2025-07-10 16:51:02 +05:30
environment:
2025-07-19 20:30:14 +05:30
- POSTGRES_HOST=nextcloud_db:5432
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- REDIS_HOST=nextcloud_valkey
- REDIS_HOST_PORT=6379
- REDIS_HOST_PASSWORD=${VALKEY_PASSWORD}
- PHP_MEMORY_LIMIT=${PHP_MEMORY_LIMIT}
- PHP_UPLOAD_LIMIT=${PHP_UPLOAD_LIMIT}
- APACHE_DISABLE_REWRITE_IP=${APACHE_DISABLE_REWRITE_IP}
2025-07-10 16:47:19 +05:30
volumes:
- ${APPDATA_PATH}/nextcloud/app:/var/www/html
2025-07-20 22:08:40 +05:30
networks:
- frontend
- backend
networks:
frontend:
external: true
backend:
external: true