From 2a019e2a0f603bb80483601141ffd2d803e09f76 Mon Sep 17 00:00:00 2001 From: ruslandoga <67764432+ruslandoga@users.noreply.github.com> Date: Sat, 14 Sep 2024 14:07:25 +0700 Subject: [PATCH] wip --- README.md | 24 ++++++++++++++++++------ compose.yml | 6 ------ 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 95217cc..beca65f 100644 --- a/README.md +++ b/README.md @@ -27,25 +27,37 @@ compose.yml ``` -1. Create and configure your [environment file:](https://docs.docker.com/compose/environment-variables/) +1. Create and configure your [environment](https://docs.docker.com/compose/environment-variables/) file: ```console $ touch .env - - $ echo "HTTP_PORT=80" >> .env - $ echo "HTTPS_PORT=443" >> .env $ echo "BASE_URL=https://plausible.example.com" >> .env $ echo "SECRET_KEY_BASE=$(openssl rand -base64 48)" >> .env $ cat .env - HTTP_PORT=80 - HTTPS_PORT=443 BASE_URL=https://plausible.example.com SECRET_KEY_BASE=As0fZsJlUpuFYSthRjT5Yflg/NlxkFKPRro72xMLXF8yInZ60s6xGGXYVqml+XN1 ``` Make sure `$BASE_URL` is set to the actual domain where you plan to host the service. The domain must have a DNS entry pointing to your server for proper resolution and automatic Let's Encrypt TLS certificate issuance. +1. Expose Plausible server to the web with an [override file:](./wiki/compose-override) + + ```console + $ cat > compose.override.yml << EOF + services: + plausible: + ports: + - 80:80 + - 443:443 + environment: + - HTTP_PORT=80 + - HTTPS_PORT=443 + EOF + ``` + + Setting `HTTP_PORT=80` and `HTTPS_PORT=443` enables automatic Let's Encrypt TLS certificate issuance. You might want to choose different values if, for example, you plan to run Plausible behind [a reverse proxy.](./wiki/reverse-proxy) + 1. Start the services with Docker Compose: ```console diff --git a/compose.yml b/compose.yml index 9ee7537..834975c 100644 --- a/compose.yml +++ b/compose.yml @@ -39,10 +39,6 @@ services: condition: service_healthy plausible_events_db: condition: service_healthy - ports: - # Note that setting ports opens firewall for external access. - - 80:${HTTP_PORT} - - 443:${HTTPS_PORT} volumes: - plausible-data:/var/lib/plausible ulimits: @@ -52,8 +48,6 @@ services: environment: - BASE_URL=${BASE_URL} - SECRET_KEY_BASE=${SECRET_KEY_BASE} - - HTTP_PORT - - HTTPS_PORT volumes: db-data: