From 2e9dd1560eca06b5527ded92f62b712b023fc7e0 Mon Sep 17 00:00:00 2001 From: birjolaxew Date: Fri, 30 Oct 2020 05:32:47 +0100 Subject: [PATCH] Add docker-compose file for simple reverse proxy Based on caddy-gen This will start a reverse proxy on port 80 and 443, which proxies to the plausible container. Note that it will clash with any existing reverse proxies on the host machine --- reverse-proxy/README.md | 9 +++++++ reverse-proxy/docker-compose.caddy-gen.yml | 28 ++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 reverse-proxy/README.md create mode 100644 reverse-proxy/docker-compose.caddy-gen.yml diff --git a/reverse-proxy/README.md b/reverse-proxy/README.md new file mode 100644 index 0000000..b37ae18 --- /dev/null +++ b/reverse-proxy/README.md @@ -0,0 +1,9 @@ +This directory contains pre-made configurations for various reverse proxies. Which flavor you should choose depends on your setup. + +## No existing reverse proxy + +If you aren't running an existing reverse proxy, then you can use the [`caddy-gen`](https://github.com/wemake-services/caddy-gen) based docker-compose file. Update it to include the domain name you use for your server, then combine it with the existing docker-compose files: + +```shell +$ docker-compose -f docker-compose.yml -f reverse-proxy/docker-compose.caddy-gen.yml up +``` diff --git a/reverse-proxy/docker-compose.caddy-gen.yml b/reverse-proxy/docker-compose.caddy-gen.yml new file mode 100644 index 0000000..1d23502 --- /dev/null +++ b/reverse-proxy/docker-compose.caddy-gen.yml @@ -0,0 +1,28 @@ +version: "3.3" +services: + caddy-gen: + container_name: caddy-gen + image: "wemakeservices/caddy-gen:latest" + restart: always + volumes: + - /var/run/docker.sock:/tmp/docker.sock:ro + - caddy-certificates:/data/caddy + ports: + - "80:80" + - "443:443" + depends_on: + - plausible + + plausible: + ports: + - 8000:8000 + labels: + virtual.host: "example.com" # change to your domain name + virtual.alias: "www.example.com" # change to any aliases you use (or remove) + virtual.port: "8000" + virtual.tls-email: "admin@example.com" # change to your email + +volumes: + caddy-certificates: + driver: local + \ No newline at end of file