commit c0fcca12ac23fdf0e7824325b177d392b0db1e26 Author: Uku Taht Date: Tue Sep 29 15:00:52 2020 +0300 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..c3d5e56 --- /dev/null +++ b/README.md @@ -0,0 +1,12 @@ +# Plausible Analytics setup examples + +This repository acts as a a template to get up and running with [Plausible Analytics](https://github.com/plausible/analytics). + +### How to use + +Find instructions on how to run Plausible Analytics Self Hosted [in our docs](https://docs.plausible.io/self-hosting). + +### Contributing + +We are always looking to expand on the options and setups provided here. Feel free to open an issue or PR if you feel +something could be improved. diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..38307ab --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,52 @@ +version: "3.3" +services: + mail: + image: bytemark/smtp + restart: always + + plausible_db: + image: postgres:12 + volumes: + - db-data:/var/lib/postgresql/data + environment: + - POSTGRES_PASSWORD=postgres + ports: + - 5432:5432 + + plausible_events_db: + image: yandex/clickhouse-server:latest + volumes: + - event-data:/var/lib/clickhouse + ulimits: + nofile: + soft: 262144 + hard: 262144 + ports: + - 8123:8123 + + plausible: + #image: plausible/analytics + build: + context: ../plausible + dockerfile: ./Dockerfile + command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run" + depends_on: + - plausible_db + - plausible_events_db + - mail + ports: + - 80:8000 + links: + - plausible_db + - plausible_events_db + - mail + env_file: + - plausible-conf.env + +volumes: + db-data: + driver: local + event-data: + driver: local + geoip: + driver: local diff --git a/geoip/docker-compose.geoip.yml b/geoip/docker-compose.geoip.yml new file mode 100644 index 0000000..ed6f11b --- /dev/null +++ b/geoip/docker-compose.geoip.yml @@ -0,0 +1,25 @@ +version: "3.3" +services: + plausible: + depends_on: + - geoip + links: + - geoip + environment: + - GEOLITE2_COUNTRY_DB=/geoip/GeoLite2-Country.mmdb + + geoip: + image: maxmindinc/geoipupdate + ports: + - 1080:1080 + environment: + - GEOIPUPDATE_EDITION_IDS=GeoLite2-Country + - GEOIPUPDATE_FREQUENCY=168 # update every 7 days + env_file: + geoip/geoip.conf + volumes: + - geoip:/usr/share/GeoIP + +volumes: + geoip: + driver: local diff --git a/geoip/geoip.conf b/geoip/geoip.conf new file mode 100644 index 0000000..d093e5e --- /dev/null +++ b/geoip/geoip.conf @@ -0,0 +1,2 @@ +GEOIPUPDATE_ACCOUNT_ID= +GEOIPUPDATE_LICENSE_KEY= diff --git a/plausible-conf.env b/plausible-conf.env new file mode 100644 index 0000000..7c8d24d --- /dev/null +++ b/plausible-conf.env @@ -0,0 +1,4 @@ +ADMIN_USER_EMAIL={replace-me} +ADMIN_USER_NAME={replace-me} +ADMIN_USER_PWD={replace-me} +SECRET_KEY_BASE={replace-me}