Files
cloudy/swarm/nextcloud.yml
T

98 lines
2.8 KiB
YAML

services:
# Note: PostgreSQL is an external service. You can find more information about the configuration here:
# https://hub.docker.com/_/postgres
db:
# Note: Check the recommend version here: https://docs.nextcloud.com/server/latest/admin_manual/installation/system_requirements.html#server
image: postgres:alpine
restart: always
volumes:
- db:/var/lib/postgresql/data:Z
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- nextcloud-net
# Note: Redis is an external service. You can find more information about the configuration here:
# https://hub.docker.com/_/redis
redis:
image: redis:alpine
restart: always
networks:
- nextcloud-net
app:
image: nextcloud:fpm-alpine
restart: always
volumes:
- nextcloud:/var/www/html:z
# NOTE: The `volumes` config of the `cron` and `app` containers must match
environment:
POSTGRES_HOST: db
REDIS_HOST: redis
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
networks:
- nextcloud-net
depends_on:
- db
- redis
# Note: Nginx is an external service. You can find more information about the configuration here:
# https://hub.docker.com/_/nginx/
web:
image: nginx:alpine-slim
environment:
- DOMAIN=${DOMAIN}
restart: always
expose:
- "80"
volumes:
# https://docs.nextcloud.com/server/latest/admin_manual/installation/nginx.html
- ./web/nginx.conf:/etc/nginx/nginx.conf:ro
# NOTE: The `volumes` included below should match those of the `app` container (unless you know what you're doing)
- nextcloud:/var/www/html:z,ro
depends_on:
- app
networks:
- traefik-public
- nextcloud-net
deploy:
restart_policy:
condition: any
delay: 5s
max_attempts: 3
labels:
- traefik.enable=true
- traefik.swarm.network=traefik-public
- traefik.constraint-label=traefik-public
- traefik.http.routers.nextcloud.entrypoints=https
- traefik.http.routers.nextcloud.rule=Host(`cloud.${DOMAIN}`)
- traefik.http.routers.nextcloud.tls.certresolver=le
- traefik.http.services.nextcloud.loadbalancer.server.port=80
cron:
image: nextcloud:fpm-alpine
restart: always
volumes:
- nextcloud:/var/www/html:z
# NOTE: The `volumes` config of the `cron` and `app` containers must match
entrypoint: /cron.sh
networks:
- nextcloud-net
depends_on:
- db
- redis
volumes:
db:
nextcloud:
networks:
traefik-public:
external: true
nextcloud-net:
driver: overlay
attachable: true