aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2020-11-09 10:36:13 +0100
committerArthurHoaro <arthur@hoa.ro>2020-11-09 10:36:13 +0100
commitb7c50a58dedc00a6d34793fc3393aaabf808ab94 (patch)
tree72e2e251edfb0dcd843711eadfae4634883dc411
parentd9d71b10c3bc70a0881d630b37dc4e918c9e812f (diff)
downloadShaarli-b7c50a58dedc00a6d34793fc3393aaabf808ab94.tar.gz
Shaarli-b7c50a58dedc00a6d34793fc3393aaabf808ab94.tar.zst
Shaarli-b7c50a58dedc00a6d34793fc3393aaabf808ab94.zip
Docker-compose: fix SSL certificate + add parameter for Docker tag
Use envvar SHAARLI_VIRTUAL_HOST for Traefik's docker.domain parameter instead of localhost (I'm not sure if did work at some point). Add an environment variable to choose which Docker tag to use instead of using master by default. Fixes #1632
-rw-r--r--doc/md/Docker.md7
-rw-r--r--docker-compose.yml9
2 files changed, 10 insertions, 6 deletions
diff --git a/doc/md/Docker.md b/doc/md/Docker.md
index c152fe92..fc406c00 100644
--- a/doc/md/Docker.md
+++ b/doc/md/Docker.md
@@ -1,3 +1,4 @@
1
1# Docker 2# Docker
2 3
3[Docker](https://docs.docker.com/get-started/overview/) is an open platform for developing, shipping, and running applications 4[Docker](https://docs.docker.com/get-started/overview/) is an open platform for developing, shipping, and running applications
@@ -113,9 +114,11 @@ $ mkdir shaarli && cd shaarli
113# Download the latest version of Shaarli's docker-compose.yml 114# Download the latest version of Shaarli's docker-compose.yml
114$ curl -L https://raw.githubusercontent.com/shaarli/Shaarli/latest/docker-compose.yml -o docker-compose.yml 115$ curl -L https://raw.githubusercontent.com/shaarli/Shaarli/latest/docker-compose.yml -o docker-compose.yml
115# Create the .env file and fill in your VPS and domain information 116# Create the .env file and fill in your VPS and domain information
116# (replace <MY_SHAARLI_DOMAIN> and <MY_CONTACT_EMAIL> with your actual information) 117# (replace <shaarli.mydomain.org>, <admin@mydomain.org> and <latest> with your actual information)
117$ echo 'SHAARLI_VIRTUAL_HOST=shaarli.mydomain.org' > .env 118$ echo 'SHAARLI_VIRTUAL_HOST=shaarli.mydomain.org' > .env
118$ echo 'SHAARLI_LETSENCRYPT_EMAIL=admin@mydomain.org' >> .env 119$ echo 'SHAARLI_LETSENCRYPT_EMAIL=admin@mydomain.org' >> .env
120# Available Docker tags can be found at https://hub.docker.com/r/shaarli/shaarli/tags
121$ echo 'SHAARLI_DOCKER_TAG=latest' >> .env
119# Pull the Docker images 122# Pull the Docker images
120$ docker-compose pull 123$ docker-compose pull
121# Run! 124# Run!
@@ -224,4 +227,4 @@ $ docker system prune
224- [docker pull](https://docs.docker.com/engine/reference/commandline/pull/) 227- [docker pull](https://docs.docker.com/engine/reference/commandline/pull/)
225- [docker run](https://docs.docker.com/engine/reference/commandline/run/) 228- [docker run](https://docs.docker.com/engine/reference/commandline/run/)
226- [docker-compose logs](https://docs.docker.com/compose/reference/logs/) 229- [docker-compose logs](https://docs.docker.com/compose/reference/logs/)
227- Træfik: [Getting Started](https://docs.traefik.io/), [Docker backend](https://docs.traefik.io/configuration/backends/docker/), [Let's Encrypt](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/), [Docker image](https://hub.docker.com/_/traefik/) \ No newline at end of file 230- Træfik: [Getting Started](https://docs.traefik.io/), [Docker backend](https://docs.traefik.io/configuration/backends/docker/), [Let's Encrypt](https://docs.traefik.io/user-guide/docker-and-lets-encrypt/), [Docker image](https://hub.docker.com/_/traefik/)
diff --git a/docker-compose.yml b/docker-compose.yml
index a3de4b1c..4ebae447 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -2,12 +2,13 @@
2# Shaarli - Docker Compose example configuration 2# Shaarli - Docker Compose example configuration
3# 3#
4# See: 4# See:
5# - https://shaarli.readthedocs.io/en/master/docker/shaarli-images/ 5# - https://shaarli.readthedocs.io/en/master/Docker/#docker-compose
6# - https://shaarli.readthedocs.io/en/master/guides/install-shaarli-with-debian9-and-docker/
7# 6#
8# Environment variables: 7# Environment variables:
9# - SHAARLI_VIRTUAL_HOST Fully Qualified Domain Name for the Shaarli instance 8# - SHAARLI_VIRTUAL_HOST Fully Qualified Domain Name for the Shaarli instance
10# - SHAARLI_LETSENCRYPT_EMAIL Contact email for certificate renewal 9# - SHAARLI_LETSENCRYPT_EMAIL Contact email for certificate renewal
10# - SHAARLI_DOCKER_TAG Shaarli docker tag to use
11# See: https://hub.docker.com/r/shaarli/shaarli/tags
11version: '3' 12version: '3'
12 13
13networks: 14networks:
@@ -20,7 +21,7 @@ volumes:
20 21
21services: 22services:
22 shaarli: 23 shaarli:
23 image: shaarli/shaarli:master 24 image: shaarli/shaarli:${SHAARLI_DOCKER_TAG}
24 build: ./ 25 build: ./
25 networks: 26 networks:
26 - http-proxy 27 - http-proxy
@@ -40,7 +41,7 @@ services:
40 - "--entrypoints=Name:https Address::443 TLS" 41 - "--entrypoints=Name:https Address::443 TLS"
41 - "--retry" 42 - "--retry"
42 - "--docker" 43 - "--docker"
43 - "--docker.domain=docker.localhost" 44 - "--docker.domain=${SHAARLI_VIRTUAL_HOST}"
44 - "--docker.exposedbydefault=true" 45 - "--docker.exposedbydefault=true"
45 - "--docker.watch=true" 46 - "--docker.watch=true"
46 - "--acme" 47 - "--acme"