Change configuration and docker compose

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2019-01-03 11:33:52 +01:00
parent 3c1b0448a8
commit 6885c73aa8
9 changed files with 60 additions and 28 deletions

View File

@@ -7,7 +7,13 @@ use Mix.Config
# watchers to your application. For example, we use it
# with brunch.io to recompile .js and .css sources.
config :mobilizon, MobilizonWeb.Endpoint,
http: [port: System.get_env("PORT") || 4001],
http: [
port: System.get_env("MOBILIZON_INSTANCE_PORT") || 4001
],
url: [
host: System.get_env("MOBILIZON_INSTANCE_HOST") || "mobilizon.dev",
port: System.get_env("MOBILIZON_INSTANCE_PORT") || 4001
],
debug_errors: true,
code_reloader: true,
check_origin: false,
@@ -53,8 +59,9 @@ config :mobilizon, Mobilizon.Mailer, adapter: Bamboo.LocalAdapter
config :mobilizon, Mobilizon.Repo,
adapter: Ecto.Adapters.Postgres,
types: Mobilizon.PostgresTypes,
username: System.get_env("POSTGRES_USER") || "elixir",
password: System.get_env("POSTGRES_PASSWORD") || "elixir",
database: System.get_env("POSTGRES_DATABASE") || "mobilizon_dev",
hostname: System.get_env("POSTGRES_HOST") || "localhost",
username: System.get_env("MOBILIZON_DATABASE_USERNAME") || "mobilizon",
password: System.get_env("MOBILIZON_DATABASE_PASSWORD") || "mobilizon",
database: System.get_env("MOBILIZON_DATABASE_DBNAME") || "mobilizon_dev",
hostname: System.get_env("MOBILIZON_DATABASE_HOST") || "localhost",
port: System.get_env("MOBILIZON_DATABASE_PORT") || "5432",
pool_size: 10

View File

@@ -16,8 +16,11 @@ use Mix.Config
config :mobilizon, MobilizonWeb.Endpoint,
load_from_system_env: true,
url: [
host: System.get_env("MOBILIZON_INSTANCE_HOST") || "example.com",
port: 80
host: System.get_env("MOBILIZON_INSTANCE_HOST") || "mobilizon.me",
port: System.get_env("MOBILIZON_INSTANCE_PORT") || 4000
],
http: [
port: System.get_env("MOBILIZON_INSTANCE_PORT") || 4000
],
secret_key_base:
System.get_env("MOBILIZON_SECRET") || "ThisShouldBeAVeryStrongStringPleaseReplaceMe",
@@ -26,6 +29,7 @@ config :mobilizon, MobilizonWeb.Endpoint,
# Configure your database
config :mobilizon, Mobilizon.Repo,
adapter: Ecto.Adapters.Postgres,
types: Mobilizon.PostgresTypes,
username: System.get_env("MOBILIZON_DATABASE_USERNAME") || "mobilizon",
password: System.get_env("MOBILIZON_DATABASE_PASSWORD") || "mobilizon",
database: System.get_env("MOBILIZON_DATABASE_DBNAME") || "mobilizon_prod",

View File

@@ -3,7 +3,13 @@ use Mix.Config
# We don't run a server during test. If one is required,
# you can enable the server option below.
config :mobilizon, MobilizonWeb.Endpoint,
http: [port: 4001],
http: [
port: System.get_env("MOBILIZON_INSTANCE_PORT") || 4002
],
url: [
host: System.get_env("MOBILIZON_INSTANCE_HOST") || "mobilizon.test",
port: System.get_env("MOBILIZON_INSTANCE_PORT") || 4002
],
server: false
# Print only warnings and errors during test
@@ -15,10 +21,11 @@ config :logger,
# Configure your database
config :mobilizon, Mobilizon.Repo,
adapter: Ecto.Adapters.Postgres,
username: System.get_env("POSTGRES_USER") || "elixir",
password: System.get_env("POSTGRES_PASSWORD") || "elixir",
database: "mobilizon_test",
hostname: System.get_env("POSTGRES_HOST") || "localhost",
types: Mobilizon.PostgresTypes,
username: System.get_env("MOBILIZON_DATABASE_USERNAME") || "mobilizon",
password: System.get_env("MOBILIZON_DATABASE_PASSWORD") || "mobilizon",
database: System.get_env("MOBILIZON_DATABASE_DBNAME") || "mobilizon_test",
hostname: System.get_env("MOBILIZON_DATABASE_HOST") || "localhost",
pool: Ecto.Adapters.SQL.Sandbox,
types: Mobilizon.PostgresTypes