Fix dev environment startup errors (#1990)

* Include gelocation DB download in the development workflow

* Make sure `tls_certificate_check` is started ASAP

This prevents `:application_either_not_started_or_not_ready` errors
on application startup.

* Mark Makefile targets as PHONY

By default Make assumes the targets are files,
in this case none of them are.
pull/1992/head
Adam Rutkowski 4 years ago committed by GitHub
parent 1cdffb098e
commit 45cc1d27a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -15,6 +15,7 @@ Make sure Docker, Elixir, Erlang and Node.js are all installed on your developme
2. Run `mix ecto.create`. This will create the required databases in both Postgres and Clickhouse.
3. Run `mix ecto.migrate` to build the database schema.
4. Run `npm ci --prefix assets` to install the required node dependencies.
5. Run `mix download_country_database` to fetch geolocation database
3. Run `make server` or `mix phx.server` to start the Phoenix server.
4. The system is now available on `localhost:8000`.

@ -1,7 +1,10 @@
.PHONY: install server clickhouse clickhouse-arm clickhouse-stop postgres postgres-stop dummy_event
install:
mix deps.get
mix ecto.create
mix ecto.migrate
mix download_country_database
npm install --prefix assets
server:

@ -114,7 +114,7 @@ geolite2_country_db =
get_var_from_path_or_env(
config_dir,
"GEOLITE2_COUNTRY_DB",
Application.app_dir(:plausible) <> "/priv/geodb/dbip-city-lite-2022-05.mmdb"
Application.app_dir(:plausible, "/priv/geodb/dbip-country.mmdb")
)
ip_geolocation_db = get_var_from_path_or_env(config_dir, "IP_GEOLOCATION_DB", geolite2_country_db)

@ -36,7 +36,8 @@ defmodule Plausible.MixProject do
mod: {Plausible.Application, []},
extra_applications: [
:logger,
:runtime_tools
:runtime_tools,
:tls_certificate_check
]
]
end

Loading…
Cancel
Save