Skip to content

Commit

Permalink
WIP: Provide a Docker Compose example
Browse files Browse the repository at this point in the history
Closes shaarli#1010

TODO:
- deploy on a VPS with an actual domain
- write a supporting deployment guide / article

See:
- https://hub.docker.com/r/jwilder/nginx-proxy/
- https://hub.docker.com/r/jrcs/letsencrypt-nginx-proxy-companion/
- https://docs.docker.com/compose/environment-variables/

Signed-off-by: VirtualTam <[email protected]>
  • Loading branch information
virtualtam committed Jun 30, 2018
1 parent c429f28 commit bb2474a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 0 deletions.
Empty file added .dockercompose/acme.json
Empty file.
29 changes: 29 additions & 0 deletions .dockercompose/traefik.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
debug = false

logLevel = "ERROR"
defaultEntryPoints = ["https","http"]

[entryPoints]
[entryPoints.http]
address = ":80"
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
[entryPoints.https.tls]

[retry]

[docker]
endpoint = "unix:///var/run/docker.sock"
domain = "my-awesome-app.org"
watch = true
exposedByDefault = false

[acme]
email = "[email protected]"
storage = "acme.json"
entryPoint = "https"
onHostRule = true
[acme.httpChallenge]
entryPoint = "http"
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
.github
tests

# Docker Compose resources
docker-compose.env
docker-compose.yml

# Shaarli runtime resources
cache/*
data/*
Expand Down
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions docker-compose.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
SHAARLI_VIRTUAL_HOST=shaarli.local
SHAARLI_LETSENCRYPT_EMAIL=[email protected]
35 changes: 35 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
version: '3'

networks:
http-proxy:

volumes:
shaarli-data:

services:
shaarli:
image: shaarli/shaarli:master
build: ./
networks:
- http-proxy
volumes:
- shaarli-data:/var/www/shaarli/data
- $PWD/.dockercompose/traefik.toml:/traefik.toml
- $PWD/.dockercompose/acme.json:/acme.json
labels:
traefik.docker.network: http-proxy
traefik.domain: "${SHAARLI_VIRTUAL_HOST}"
traefik.backend: shaarli
traefik.frontend.rule: "Host:${SHAARLI_VIRTUAL_HOST}"

traefik:
image: traefik
ports:
- 80:80
- 443:443
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- /dev/null:/traefik.toml
labels:
traefik.docker.network: http-proxy

0 comments on commit bb2474a

Please sign in to comment.