docker-compose.yml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. # Shaarli - Docker Compose example configuration
  3. #
  4. # See:
  5. # - https://shaarli.readthedocs.io/en/master/Docker/#docker-compose
  6. #
  7. # Environment variables:
  8. # - SHAARLI_VIRTUAL_HOST Fully Qualified Domain Name for the Shaarli instance
  9. # - SHAARLI_LETSENCRYPT_EMAIL Contact email for certificate renewal
  10. # - SHAARLI_DOCKER_TAG Shaarli docker tag to use
  11. # See: https://github.com/shaarli/Shaarli/pkgs/container/shaarli/versions?filters%5Bversion_type%5D=tagged
  12. version: '3'
  13. networks:
  14. http-proxy:
  15. volumes:
  16. traefik-acme:
  17. shaarli-cache:
  18. shaarli-data:
  19. services:
  20. shaarli:
  21. image: ghcr.io/shaarli/shaarli:${SHAARLI_DOCKER_TAG}
  22. build: ./
  23. networks:
  24. - http-proxy
  25. volumes:
  26. - shaarli-cache:/var/www/shaarli/cache
  27. - shaarli-data:/var/www/shaarli/data
  28. labels:
  29. traefik.domain: "${SHAARLI_VIRTUAL_HOST}"
  30. traefik.backend: shaarli
  31. traefik.frontend.rule: "Host:${SHAARLI_VIRTUAL_HOST}"
  32. traefik:
  33. image: traefik:1.7-alpine
  34. command:
  35. - "--defaultentrypoints=http,https"
  36. - "--entrypoints=Name:http Address::80 Redirect.EntryPoint:https"
  37. - "--entrypoints=Name:https Address::443 TLS"
  38. - "--retry"
  39. - "--docker"
  40. - "--docker.domain=${SHAARLI_VIRTUAL_HOST}"
  41. - "--docker.exposedbydefault=true"
  42. - "--docker.watch=true"
  43. - "--acme"
  44. - "--acme.domains=${SHAARLI_VIRTUAL_HOST}"
  45. - "--acme.email=${SHAARLI_LETSENCRYPT_EMAIL}"
  46. - "--acme.entrypoint=https"
  47. - "--acme.onhostrule=true"
  48. - "--acme.storage=/acme/acme.json"
  49. - "--acme.httpchallenge"
  50. - "--acme.httpchallenge.entrypoint=http"
  51. networks:
  52. - http-proxy
  53. ports:
  54. - 80:80
  55. - 443:443
  56. volumes:
  57. - /var/run/docker.sock:/var/run/docker.sock:ro
  58. - traefik-acme:/acme