docker compose dev environment
Some checks failed
CI/CD Pipeline / build (push) Failing after 4s

This commit is contained in:
2026-03-10 10:09:27 -06:00
parent d01ae816d2
commit b3619a145f
6 changed files with 211 additions and 101 deletions

View File

@@ -16,9 +16,7 @@ config :elixir_ai, ElixirAi.Repo,
# watchers to your application. For example, we can use it
# to bundle .js and .css sources.
config :elixir_ai, ElixirAiWeb.Endpoint,
# Binding to loopback ipv4 address prevents access from other machines.
# Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
http: [ip: {127, 0, 0, 1}, port: 4000],
http: [ip: {0, 0, 0, 0}, port: 4000],
check_origin: false,
code_reloader: true,
debug_errors: true,
@@ -28,7 +26,6 @@ config :elixir_ai, ElixirAiWeb.Endpoint,
tailwind: {Tailwind, :install_and_run, [:elixir_ai, ~w(--watch)]}
]
# Watch static and templates for browser reloading.
config :elixir_ai, ElixirAiWeb.Endpoint,
live_reload: [

View File

@@ -28,6 +28,15 @@ if System.get_env("PHX_SERVER") do
config :elixir_ai, ElixirAiWeb.Endpoint, server: true
end
# In dev mode, if DATABASE_URL is set (e.g., in Docker), use it instead of defaults
if config_env() == :dev do
if database_url = System.get_env("DATABASE_URL") do
config :elixir_ai, ElixirAi.Repo,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
end
end
if config_env() == :prod do
secret_key_base =
System.get_env("SECRET_KEY_BASE") ||