X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=docker-compose.yml;fp=docker-compose.yml;h=e8ea4271267fb4f02659b78ebf17295ebc9d73b6;hb=38672ba0d1c722e5d6d33a58255ceb55e9410e46;hp=0000000000000000000000000000000000000000;hpb=83faedadff76c5bdca036f39f13943f63b27e164;p=github%2Fshaarli%2FShaarli.git diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..e8ea4271 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,61 @@ +--- +# Shaarli - Docker Compose example configuration +# +# See: +# - https://shaarli.readthedocs.io/en/master/docker/shaarli-images/ +# - https://shaarli.readthedocs.io/en/master/guides/install-shaarli-with-debian9-and-docker/ +# +# Environment variables: +# - SHAARLI_VIRTUAL_HOST Fully Qualified Domain Name for the Shaarli instance +# - SHAARLI_LETSENCRYPT_EMAIL Contact email for certificate renewal +version: '3' + +networks: + http-proxy: + +volumes: + traefik-acme: + shaarli-cache: + shaarli-data: + +services: + shaarli: + image: shaarli/shaarli:master + build: ./ + networks: + - http-proxy + volumes: + - shaarli-cache:/var/www/shaarli/cache + - shaarli-data:/var/www/shaarli/data + labels: + traefik.domain: "${SHAARLI_VIRTUAL_HOST}" + traefik.backend: shaarli + traefik.frontend.rule: "Host:${SHAARLI_VIRTUAL_HOST}" + + traefik: + image: traefik + command: + - "--defaultentrypoints=http,https" + - "--entrypoints=Name:http Address::80 Redirect.EntryPoint:https" + - "--entrypoints=Name:https Address::443 TLS" + - "--retry" + - "--docker" + - "--docker.domain=docker.localhost" + - "--docker.exposedbydefault=true" + - "--docker.watch=true" + - "--acme" + - "--acme.domains=${SHAARLI_VIRTUAL_HOST}" + - "--acme.email=${SHAARLI_LETSENCRYPT_EMAIL}" + - "--acme.entrypoint=https" + - "--acme.onhostrule=true" + - "--acme.storage=/acme/acme.json" + - "--acme.httpchallenge" + - "--acme.httpchallenge.entrypoint=http" + networks: + - http-proxy + ports: + - 80:80 + - 443:443 + volumes: + - /var/run/docker.sock:/var/run/docker.sock:ro + - traefik-acme:/acme