Docker/Nextcloud/docker-compose.yaml

135 lines
3.4 KiB
YAML

services:
aio-apache:
depends_on:
aio-nextcloud:
condition: service_started
required: false
aio-notify-push:
condition: service_started
required: false
image: nextcloud/aio-apache:latest
init: true
ports:
- ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/tcp
- ${APACHE_IP_BINDING}:${APACHE_PORT}:${APACHE_PORT}/udp
env_file:
- stack.env
volumes:
- nextcloud_aio_nextcloud:/var/www/html:ro
- nextcloud_aio_apache:/mnt/data:rw
restart: unless-stopped
networks:
- nextcloud-aio
read_only: true
tmpfs:
- /var/log/supervisord
- /var/run/supervisord
- /usr/local/apache2/logs
- /tmp
- /home/www-data
labels:
- traefik.enable=true
# HTTP redirection to HTTPS
- traefik.http.routers.nextcloud.entrypoints=web
- traefik.http.routers.nextcloud.rule=Host(`${NEXTCLOUD_URL}`)
- traefik.http.middlewares.nextcloud-https-redirect.redirectscheme.scheme=https
- traefik.http.routers.nextcloud.middlewares=nextcloud-https-redirect
# HTTPS config
- traefik.http.routers.nextcloud-secure.entrypoints=websecure
- traefik.http.routers.nextcloud-secure.rule=Host(`${NEXTCLOUD_URL}`)
- traefik.http.routers.nextcloud-secure.tls=true
- traefik.http.routers.nextcloud-secure.tls.certresolver=myresolver
- traefik.http.services.nextcloud-secure.loadbalancer.server.port=21000
- traefik.docker.network=proxy
aio-database:
image: nextcloud/aio-postgresql:latest
init: true
expose:
- "5432"
volumes:
- nextcloud_aio_database:/var/lib/postgresql/data:rw
- nextcloud_aio_database_dump:/mnt/data:rw
env_file:
- stack.env
stop_grace_period: 1800s
restart: unless-stopped
shm_size: 268435456
networks:
- nextcloud-aio
read_only: true
tmpfs:
- /var/run/postgresql
aio-nextcloud:
depends_on:
aio-database:
condition: service_started
required: false
aio-redis:
condition: service_started
required: false
image: nextcloud/aio-nextcloud:latest
init: true
expose:
- "9000"
- "9001"
volumes:
- nextcloud_aio_nextcloud:/var/www/html:rw
- ${NEXTCLOUD_USER_DIR}:/mnt/ncdata:rw
- ${NEXTCLOUD_DOCKER_DIR}:/mnt:rw
- ${NEXTCLOUD_TRUSTED_CACERTS_DIR}:/usr/local/share/ca-certificates:ro
env_file:
- stack.env
stop_grace_period: 600s
restart: unless-stopped
networks:
- nextcloud-aio
aio-notify-push:
image: nextcloud/aio-notify-push:latest
init: true
expose:
- "7867"
volumes:
- nextcloud_aio_nextcloud:/nextcloud:ro
env_file:
- stack.env
restart: unless-stopped
networks:
- nextcloud-aio
read_only: true
aio-redis:
image: nextcloud/aio-redis:latest
init: true
expose:
- "6379"
env_file:
- stack.env
volumes:
- nextcloud_aio_redis:/data:rw
restart: unless-stopped
networks:
- nextcloud-aio
read_only: true
volumes:
nextcloud_aio_apache:
name: nextcloud_aio_apache
nextcloud_aio_database:
name: nextcloud_aio_database
nextcloud_aio_database_dump:
name: nextcloud_aio_database_dump
nextcloud_aio_nextcloud:
name: nextcloud_aio_nextcloud
nextcloud_aio_redis:
name: nextcloud_aio_redis
networks:
nextcloud-aio:
name: nextcloud-aio
driver: bridge