docker-compose.yml 1.6 KB

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