2020-09-08 22:52:37 +00:00
|
|
|
version: "3.8"
|
2020-06-26 23:43:19 +00:00
|
|
|
|
|
|
|
services:
|
|
|
|
nextcloud:
|
|
|
|
image: nextcloud:latest
|
|
|
|
depends_on:
|
2020-06-29 14:00:04 +00:00
|
|
|
- mariadb
|
2020-06-26 23:43:19 +00:00
|
|
|
secrets:
|
2020-06-29 14:00:04 +00:00
|
|
|
- db_password
|
2020-09-08 22:52:37 +00:00
|
|
|
- admin_password
|
2020-06-26 23:43:19 +00:00
|
|
|
environment:
|
2020-06-29 14:00:04 +00:00
|
|
|
- MYSQL_HOST=mariadb
|
2020-06-26 23:43:19 +00:00
|
|
|
- MYSQL_DATABASE=nextcloud
|
2020-06-29 12:29:16 +00:00
|
|
|
- DOMAIN=${DOMAIN}
|
2020-09-08 00:38:09 +00:00
|
|
|
- STACK_NAME=${STACK_NAME}
|
2020-06-26 23:43:19 +00:00
|
|
|
volumes:
|
2020-06-29 14:00:04 +00:00
|
|
|
- nextapps:/var/www/html/custom_apps:cached
|
|
|
|
- nextdata:/var/www/html/data:cached
|
|
|
|
- nextconfig:/var/www/html/config:cached
|
2020-06-26 23:43:19 +00:00
|
|
|
networks:
|
|
|
|
- proxy
|
|
|
|
- internal
|
2020-09-08 22:52:37 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost"]
|
|
|
|
interval: 30s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
|
|
|
configs:
|
|
|
|
- source: entrypoint_conf
|
|
|
|
target: /docker-entrypoint.sh
|
|
|
|
mode: 0555
|
|
|
|
user: www-data
|
|
|
|
group: www-data
|
2020-06-26 23:43:19 +00:00
|
|
|
deploy:
|
|
|
|
restart_policy:
|
|
|
|
condition: on-failure
|
|
|
|
labels:
|
|
|
|
- "traefik.enable=true"
|
|
|
|
- "traefik.docker.network=proxy"
|
2020-09-08 00:38:09 +00:00
|
|
|
- "traefik.http.routers.${STACK_NAME}.tls=true"
|
|
|
|
- "traefik.http.services.${STACK_NAME}.loadbalancer.server.port=80"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.rule=Host(`${DOMAIN}`)"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.tls.certresolver=${LETS_ENCRYPT_ENV}"
|
|
|
|
- "traefik.http.routers.${STACK_NAME}.entrypoints=web-secure"
|
2020-09-08 22:52:37 +00:00
|
|
|
#entrypoint: ["setpriv", "--reuid=www-data", "--regid=www-data", "--init-groups", "/docker-entrypoint.sh"]
|
|
|
|
entrypoint: ["tail", "-f", "/dev/null"]
|
2020-06-29 14:00:04 +00:00
|
|
|
|
|
|
|
mariadb:
|
|
|
|
image: "mariadb:10.5"
|
|
|
|
environment:
|
|
|
|
- MYSQL_DATABASE=nextcloud
|
|
|
|
- MYSQL_USER=nextcloud
|
2020-06-29 19:58:45 +00:00
|
|
|
- MYSQL_PASSWORD_FILE=/run/secrets/db_password
|
2020-06-29 14:00:04 +00:00
|
|
|
- MYSQL_ROOT_PASSWORD_FILE=/run/secrets/db_root_password
|
|
|
|
secrets:
|
|
|
|
- db_root_password
|
|
|
|
- db_password
|
|
|
|
volumes:
|
2020-06-29 19:58:45 +00:00
|
|
|
- "mariadb:/var/lib/mysql"
|
2020-06-29 14:00:04 +00:00
|
|
|
networks:
|
|
|
|
- internal
|
2020-06-26 23:43:19 +00:00
|
|
|
|
|
|
|
secrets:
|
2020-06-29 12:29:16 +00:00
|
|
|
db_root_password:
|
2020-06-26 23:43:19 +00:00
|
|
|
external: true
|
2020-09-08 00:38:09 +00:00
|
|
|
name: ${STACK_NAME}_db_root_password_${DB_ROOT_PASSWORD_VERSION}
|
2020-06-29 14:00:04 +00:00
|
|
|
db_password:
|
|
|
|
external: true
|
2020-09-08 00:38:09 +00:00
|
|
|
name: ${STACK_NAME}_db_password_${DB_ROOT_PASSWORD_VERSION}
|
2020-09-08 22:52:37 +00:00
|
|
|
admin_password:
|
|
|
|
external: true
|
|
|
|
name: ${STACK_NAME}_admin_password_${ADMIN_PASSWORD_VERSION}
|
2020-06-26 23:43:19 +00:00
|
|
|
|
|
|
|
volumes:
|
|
|
|
nextapps:
|
|
|
|
nextdata:
|
|
|
|
nextconfig:
|
2020-06-29 14:00:04 +00:00
|
|
|
mariadb:
|
2020-06-26 23:43:19 +00:00
|
|
|
|
|
|
|
networks:
|
|
|
|
proxy:
|
|
|
|
external: true
|
2020-06-29 12:29:16 +00:00
|
|
|
internal:
|
2020-09-08 22:52:37 +00:00
|
|
|
|
|
|
|
configs:
|
|
|
|
entrypoint_conf:
|
|
|
|
name: ${STACK_NAME}_entrypoint_${ENTRYPOINT_CONF_VERSION}
|
|
|
|
file: entrypoint.sh.tmpl
|
|
|
|
template_driver: golang
|