Skip to content

Commit

Permalink
WIP: Provide a Docker Compose example
Browse files Browse the repository at this point in the history
Closes #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 <virtualtam@flibidi.net>
  • Loading branch information
virtualtam committed Jun 30, 2018
1 parent c429f28 commit db24968
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 0 deletions.
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=foo@bar.com
47 changes: 47 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
version: '3'

services:
shaarli:
image: shaarli/shaarli:master
build: ./
networks:
- proxy
volumes:
- shaarli-data:/var/www/shaarli/data
environment:
- "VIRTUAL_HOST=${SHAARLI_VIRTUAL_HOST}"
- "LETSENCRYPT_HOST=${SHAARLI_VIRTUAL_HOST}"
- "LETSENCRYPT_EMAIL=${SHAARLI_LETSENCRYPT_EMAIL}"

nginx-proxy:
image: jwilder/nginx-proxy:alpine
labels:
- com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx_proxy
networks:
- proxy
ports:
- 80:80
- 443:443
volumes:
- nginx-certs:/etc/nginx/certs:ro
- nginx-html:/usr/share/nginx/html
- nginx-vhosts:/etc/nginx/vhost.d
- /var/run/docker.sock:/tmp/docker.sock:ro

nginx-proxy-companion:
image: jrcs/letsencrypt-nginx-proxy-companion:stable
volumes:
- nginx-certs:/etc/nginx/certs:rw
- nginx-html:/usr/share/nginx/html
- nginx-vhosts:/etc/nginx/vhost.d
- /var/run/docker.sock:/var/run/docker.sock:ro

volumes:
nginx-certs:
nginx-html:
nginx-vhosts:
shaarli-data:

networks:
proxy:

0 comments on commit db24968

Please sign in to comment.