60 lines
1.6 KiB
YAML
60 lines
1.6 KiB
YAML
services:
|
|
db:
|
|
image: mariadb:11
|
|
container_name: nextcloud-db
|
|
command: --transaction-isolation=READ-COMMITTED --log-bin=binlog --binlog-format=ROW
|
|
restart: unless-stopped
|
|
environment:
|
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
|
MYSQL_USER: ${MYSQL_USER}
|
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
|
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD}
|
|
volumes:
|
|
- ./db:/var/lib/mysql
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "mariadb-admin ping -h 127.0.0.1 -u$$MYSQL_USER -p$$MYSQL_PASSWORD || exit 1"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
container_name: nextcloud-redis
|
|
restart: unless-stopped
|
|
command: redis-server --save 60 1 --loglevel warning
|
|
volumes:
|
|
- ./redis:/data
|
|
healthcheck:
|
|
test: ["CMD", "redis-cli", "ping"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 10
|
|
|
|
app:
|
|
image: nextcloud:apache
|
|
container_name: nextcloud-app
|
|
restart: unless-stopped
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
ports:
|
|
- "127.0.0.1:8080:80"
|
|
environment:
|
|
MYSQL_DATABASE: ${MYSQL_DATABASE}
|
|
MYSQL_USER: ${MYSQL_USER}
|
|
MYSQL_PASSWORD: ${MYSQL_PASSWORD}
|
|
MYSQL_HOST: db
|
|
REDIS_HOST: redis
|
|
# optional, aber oft hilfreich hinter Reverse Proxy:
|
|
TRUSTED_PROXIES: 127.0.0.1
|
|
# OVERWRITEPROTOCOL: https
|
|
volumes:
|
|
- ./html:/var/www/html
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1/status.php | grep -q 'installed'"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 10
|