]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Provide a Docker Compose example
authorVirtualTam <virtualtam@flibidi.net>
Tue, 26 Jun 2018 23:20:22 +0000 (01:20 +0200)
committerVirtualTam <virtualtam@flibidi.net>
Thu, 12 Jul 2018 19:48:48 +0000 (21:48 +0200)
Closes https://github.com/shaarli/Shaarli/issues/1010

See:
- https://hub.docker.com/_/traefik/
- https://docs.traefik.io/configuration/backends/docker/
- https://docs.traefik.io/user-guide/docker-and-lets-encrypt/
- https://github.com/containous/traefik/pull/2798
- https://github.com/containous/traefik/issues/3298

Signed-off-by: VirtualTam <virtualtam@flibidi.net>
.dockerignore
.gitattributes
docker-compose.yml [new file with mode: 0644]

index a0d28dc6212f28f3dea3f4dbb57a440071e474fa..96fd31c5bf630425977583f46de76fae72d6def9 100644 (file)
@@ -4,6 +4,9 @@
 .github
 tests
 
+# Docker Compose resources
+docker-compose.yml
+
 # Shaarli runtime resources
 cache/*
 data/*
index 9d22f11b282811b6007920e44813694a0946efd4..9a92bc37d8f1228f1ac5153b4f06cec8b8504618 100644 (file)
@@ -35,6 +35,7 @@ doc/**/*.json     export-ignore
 doc/**/*.md       export-ignore
 .docker/          export-ignore
 .dockerignore     export-ignore
+docker-compose.*  export-ignore
 Dockerfile*       export-ignore
 Doxyfile          export-ignore
 Makefile          export-ignore
diff --git a/docker-compose.yml b/docker-compose.yml
new file mode 100644 (file)
index 0000000..fc68bf3
--- /dev/null
@@ -0,0 +1,56 @@
+---
+# Shaarli - Docker Compose script
+#
+# See:
+# - https://shaarli.readthedocs.io/en/master/docker/shaarli-images/
+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