nextcloud-swarm-plugin/docker-compose.yml
Mahyar Iranibazaz 532ae7b1fb feat(docker):
- add: proxy in the setup
- add: crontab for rsync
- add: default passwords to .env
- add: skip adding localhost to trusted domains
- add: default redis password
2024-10-16 15:54:09 +08:00

143 lines
3.3 KiB
YAML
Executable file

services:
web:
build: ./docker/web
restart: unless-stopped
volumes_from:
- nextcloud
depends_on:
- nextcloud
labels:
caddy: ${APP_URL:-localhost}
caddy.reverse_proxy: '{{upstreams 80}}'
networks:
- frontend
- proxy
nextcloud:
build:
context: ./docker/nextcloud
dockerfile: ${NC_VERSION:-28}.Dockerfile
target: ${ENV:-development}
restart: unless-stopped
depends_on:
mariadb:
condition: service_healthy
redis:
condition: service_healthy
env_file:
- .env
environment:
MYSQL_HOST: mariadb:3306
REDIS_HOST: redis
networks:
- frontend
- backend
extra_hosts:
- host.docker.internal:host-gateway
volumes:
- nc-app:/var/www/html
- ./:/var/www/html/custom_apps/files_external_ethswarm
redis:
image: redis:alpine
restart: unless-stopped
environment:
REDIS_HOST_PASSWORD: ${REDIS_HOST_PASSWORD:-secret}
command: redis-server --requirepass ${REDIS_HOST_PASSWORD:-secret}
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
start_period: 3s
timeout: 5s
interval: 30s
networks:
- backend
mariadb:
image: mariadb:latest
# set transaction isolation: https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/linux_database_configuration.html
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-file-per-table=1 --skip-innodb-read-only-compressed
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-rootpassword}
MYSQL_DATABASE: ${MYSQL_DATABASE:-nextcloud}
MYSQL_USER: ${MYSQL_USER:-nextcloud}
MYSQL_PASSWORD: ${MYSQL_PASSWORD:-secret}
volumes:
- nc-db:/var/lib/mysql
healthcheck:
test: [ "CMD", "healthcheck.sh", "--su-mysql", "--connect", "--innodb_initialized" ]
start_period: 3s
timeout: 5s
interval: 30s
networks:
- backend
adminer:
image: adminer:latest
restart: unless-stopped
networks:
- backend
ports:
- '8080:8080'
depends_on:
- mariadb
environment:
ADMINER_DEFAULT_SERVER: mariadb
profiles:
- dev
rsync:
image: ogivuk/rsync
restart: unless-stopped
cpu_shares: 512
mem_limit: 256m
volumes:
- nc-app:/app:ro
- ./dev-environment/nextcloud_source:/source
- ./cli/dev/rsync:/rsync
environment:
- RSYNC_CRONTAB=crontab
depends_on:
- nextcloud
networks:
- backend
profiles:
- dev
proxy:
image: lucaslorentz/caddy-docker-proxy:alpine
restart: unless-stopped
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- caddy_data:/data
- caddy_config:/config
- /var/run/docker.sock:/var/run/docker.sock
environment:
CADDY_INGRESS_NETWORKS: hejbit-network
networks:
- proxy
healthcheck:
test: [ "CMD", "curl", "--fail", "http://localhost:2019/reverse_proxy/upstreams" ]
timeout: 30s
retries: 3
start_period: 10s
profiles:
- dev
volumes:
nc-app:
nc-db:
certs:
caddy_data:
caddy_config:
networks:
frontend:
backend:
proxy:
# external: true
name: hejbit-network