Skip to content

Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.

Add download step to docker build

Uku Taht4fd5cdff589f
diff --git a/Dockerfile b/Dockerfile
index d764bb1267..eba9f48597 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -40,7 +40,8 @@ COPY lib ./lib
RUN npm run deploy --prefix ./assets && \
npm run deploy --prefix ./tracker && \
- mix phx.digest priv/static
+ mix phx.digest priv/static && \
+ mix download_country_database
WORKDIR /app
COPY rel rel
diff --git a/config/runtime.exs b/config/runtime.exs
index d7a333552a..7c9cc1429f 100644
--- a/config/runtime.exs
+++ b/config/runtime.exs
@@ -66,7 +66,13 @@ cron_enabled = String.to_existing_atom(System.get_env("CRON_ENABLED", "false"))
custom_domain_server_ip = System.get_env("CUSTOM_DOMAIN_SERVER_IP")
custom_domain_server_user = System.get_env("CUSTOM_DOMAIN_SERVER_USER")
custom_domain_server_password = System.get_env("CUSTOM_DOMAIN_SERVER_PASSWORD")
-geolite2_country_db = System.get_env("EOLITE2_COUNTRY_DB", "priv/geodb/dbip-country.mmdb")
+
+geolite2_country_db =
+ System.get_env(
+ "GEOLITE2_COUNTRY_DB",
+ Application.app_dir(:plausible) <> "/priv/geodb/dbip-country.mmdb"
+ )
+
disable_auth = String.to_existing_atom(System.get_env("DISABLE_AUTH", "false"))
disable_registration = String.to_existing_atom(System.get_env("DISABLE_REGISTRATION", "false"))
hcaptcha_sitekey = System.get_env("HCAPTCHA_SITEKEY")