diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 59dfcc15..d2fcdeb6 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -15,6 +15,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ vim \ net-tools \ procps \ + netcat-traditional \ # Optionally add any other tools you need, e.g. vim, wget... && curl -sL https://deb.nodesource.com/setup_18.x | bash - \ && apt-get install -y --no-install-recommends nodejs inotify-tools \ diff --git a/config/runtime.exs b/config/runtime.exs index 4f53cd05..adccbf30 100644 --- a/config/runtime.exs +++ b/config/runtime.exs @@ -5,6 +5,12 @@ if System.get_env("PHX_SERVER") do config :wanderer_app, WandererAppWeb.Endpoint, server: true end +if config_env() in [:dev, :test] do + if db_host = System.get_env("DB_HOST") do + config :wanderer_app, WandererApp.Repo, hostname: db_host + end +end + config_dir = System.get_env("CONFIG_DIR", "/run/secrets") app_name = System.get_env("FLY_APP_NAME", "NOT_FLY_APP") diff --git a/config/test.exs b/config/test.exs index 3a9d0b38..728886f4 100644 --- a/config/test.exs +++ b/config/test.exs @@ -12,7 +12,7 @@ config :ash, :disable_async?, true config :wanderer_app, WandererApp.Repo, username: "postgres", password: "postgres", - hostname: System.get_env("DB_HOST", "localhost"), + hostname: "localhost", database: "wanderer_test#{System.get_env("MIX_TEST_PARTITION")}", pool: Ecto.Adapters.SQL.Sandbox, pool_size: 20,