16 Commits

Author SHA1 Message Date
831781d5f7 fixed mariadb environment 2026-07-18 17:50:45 +02:00
44571ff08b fixed middlewares 2026-07-18 13:02:37 +02:00
eefaae32e2 fixed matchrule 2026-07-18 12:59:24 +02:00
ff2c56a7de fixed ancient images in example env 2026-07-17 22:47:03 +02:00
056976e2dd fixed healthcheck 2026-07-17 22:45:34 +02:00
78e7b1a46f removed traefik http, renamed variables 2026-07-17 22:23:00 +02:00
65a4cddba0 renamed mariadb container, added healthcheck 2026-07-17 22:20:05 +02:00
efc60d1510 added php memory options for production environment 2026-03-19 10:08:21 +01:00
6abe555100 added hsts middleware for enhanced security 2022-08-16 16:05:15 +02:00
6a5f9fb8eb reordered Træfik labels 2022-08-16 16:04:55 +02:00
a435eae93d fixed middleware definition typo 2022-08-16 09:51:38 +02:00
fb5b47da0a fixed nextcloud-specific middleware definition 2022-08-16 09:48:28 +02:00
f8b7ad6cb4 added nextcloud-specific configurations in Compose service definition 2022-08-16 09:46:34 +02:00
a16892bf70 removed version, not needed as per new Compose specifications 2022-08-16 09:45:43 +02:00
1628205c35 fixed traefik network 2022-04-09 14:19:54 +02:00
1fbbd0ce96 added dependency to ensure correct startup/shutdown order 2022-04-09 14:07:15 +02:00
2 changed files with 39 additions and 28 deletions

View File

@@ -1,27 +1,30 @@
--- ---
version: "3"
services: services:
nextcloud: nextcloud:
image: nextcloud:${NC_VERSION} image: nextcloud:${NEXTCLOUD_VERSION}
restart: unless-stopped restart: unless-stopped
depends_on:
- mariadb
environment: environment:
- MYSQL_HOST=db - MYSQL_HOST=mariadb
- MYSQL_DATABASE=${NC_DATABASE_NAME} - MYSQL_DATABASE=${NEXTCLOUD_DATABASE_NAME}
- MYSQL_USER=${NC_DATABASE_USER} - MYSQL_USER=${NEXTCLOUD_DATABASE_USER}
- MYSQL_PASSWORD=${NC_DATABASE_PASS} - MYSQL_PASSWORD=${NEXTCLOUD_DATABASE_PASS}
- OVERWRITEPROTOCOL=https
- PHP_MEMORY_LIMIT=1024M
- PHP_UPLOAD_LIMIT=1024M
labels: labels:
- traefik.enable=${TRAEFIK_ENABLED} - traefik.enable=${TRAEFIK_ENABLED}
- traefik.docker.network=traefik - traefik.docker.network=${TRAEFIK_NETWORK}
### Section HTTP # specify a custom middleware for nextcloud-specific configuration
- traefik.http.routers.http-${TRAEFIK_ROUTER}.entrypoints=http - traefik.http.middlewares.${TRAEFIK_ROUTER}-redirectregex.redirectRegex.permanent=true
# redirect to HTTPS only - traefik.http.middlewares.${TRAEFIK_ROUTER}-redirectregex.redirectRegex.regex="https://(.*)/.well-known/(card|cal)dav"
- traefik.http.routers.http-${TRAEFIK_ROUTER}.middlewares=http-to-https - traefik.http.middlewares.${TRAEFIK_ROUTER}-redirectregex.redirectRegex.replacement="https://$${1}/remote.php/dav/"
- traefik.http.routers.http-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`) # HTTPS
### Section HTTPS
- traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https - traefik.http.routers.https-${TRAEFIK_ROUTER}.entrypoints=https
# configure the exposed service # configure the exposed service
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=Host(`${TRAEFIK_MATCHRULE}`) - traefik.http.routers.https-${TRAEFIK_ROUTER}.middlewares=${TRAEFIK_MIDDLEWARES}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.rule=${TRAEFIK_MATCHRULE}
# of course, enable TLS and it's certificate provider # of course, enable TLS and it's certificate provider
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED} - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls=${TRAEFIK_TLSENABLED}
- traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER} - traefik.http.routers.https-${TRAEFIK_ROUTER}.tls.certresolver=${TRAEFIK_CERTRESOLVER}
@@ -33,14 +36,21 @@ services:
volumes: volumes:
- ./data/nextcloud:/var/www/html - ./data/nextcloud:/var/www/html
db: mariadb:
image: mariadb:${DB_VERSION} image: mariadb:${MARIADB_VERSION}
restart: unless-stopped restart: unless-stopped
environment: environment:
- MYSQL_ROOT_PASSWORD=${DB_ROOT_PASS} - MARIADB_AUTO_UPGRADE=true
- MYSQL_DATABASE=${NC_DATABASE_NAME} - MARIADB_ROOT_PASSWORD=${MARIADB_ROOT_PASS}
- MYSQL_USER=${NC_DATABASE_USER} - MARIADB_DATABASE=${NEXTCLOUD_DATABASE_NAME}
- MYSQL_PASSWORD=${NC_DATABASE_PASS} - MARIADB_USER=${NEXTCLOUD_DATABASE_USER}
- MARIADB_PASSWORD=${NEXTCLOUD_DATABASE_PASS}
healthcheck:
test: ["CMD", "/usr/local/bin/healthcheck.sh", "--innodb_initialized"]
start_period: 30s
interval: 5s
timeout: 3s
retries: 3
networks: networks:
- internal - internal
volumes: volumes:

View File

@@ -1,19 +1,20 @@
# NextCloud environment # NextCloud environment
NC_VERSION=22.2.6-apache NEXTCLOUD_VERSION=latest
NC_DATABASE_NAME=nextcloud NEXTCLOUD_DATABASE_NAME=nextcloud
NC_DATABASE_USER=nextcloud NEXTCLOUD_DATABASE_USER=nextcloud
NC_DATABASE_PASS=changeme NEXTCLOUD_DATABASE_PASS=changeme
# MariaDB environment # MariaDB environment
DB_VERSION=10.7.3 MARIADB_VERSION=latest
DB_ROOT_PASS=Sup3rS3cr3tPassw0rd! MARIADB_ROOT_PASS=Sup3rS3cr3tPassw0rd!
# Træfik environment # Træfik environment
TRAEFIK_ENABLED=true TRAEFIK_ENABLED=true
TRAEFIK_CERTRESOLVER=letsencrypt TRAEFIK_CERTRESOLVER=letsencrypt
TRAEFIK_MATCHRULE=cloud.domain.com TRAEFIK_MATCHRULE=Host(`cloud.domain.com`)
TRAEFIK_ROUTER=cloud_domain_com TRAEFIK_ROUTER=cloud_domain_com
TRAEFIK_SERVICE=cloud_domain_com TRAEFIK_SERVICE=cloud_domain_com
TRAEFIK_SERVICE_PORT=80 TRAEFIK_SERVICE_PORT=80
TRAEFIK_TLSENABLED=true TRAEFIK_TLSENABLED=true
TRAEFIK_NETWORK=traefik TRAEFIK_NETWORK=traefik
TRAEFIK_MIDDLEWARES=hsts,cloud_domain_com-redirectregex