Browse Source

release config for gigalixir

main
Inhji Y. 9 months ago
parent
commit
0a0aed3058
  1. 6
      config/prod.exs
  2. 15
      config/releases.exs

6
config/prod.exs

@ -11,7 +11,8 @@ use Mix.Config
# before starting your production server.
config :mirage, MirageWeb.Endpoint,
url: [host: "example.com", port: 80],
cache_static_manifest: "priv/static/cache_manifest.json"
cache_static_manifest: "priv/static/cache_manifest.json",
pool_size: 2
# Do not print debug messages in production
config :logger, level: :info
@ -51,5 +52,4 @@ config :logger, level: :info
# Check `Plug.SSL` for all available options in `force_ssl`.
# Finally import the config/prod.secret.exs which loads secrets
# and configuration from environment variables.
import_config "prod.secret.exs"
# and configuration from environment variables.

15
config/prod.secret.exs → config/releases.exs

@ -2,7 +2,7 @@
# from environment variables. You can also hardcode secrets,
# although such is generally not recommended and you have to
# remember to add this file to your .gitignore.
use Mix.Config
import Config
database_url =
System.get_env("DATABASE_URL") ||
@ -12,7 +12,7 @@ database_url =
"""
config :mirage, Mirage.Repo,
# ssl: true,
ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
@ -23,12 +23,21 @@ secret_key_base =
You can generate one by calling: mix phx.gen.secret
"""
public_url =
System.get_env("PUBLIC_URL") ||
raise """
environment variable PUBLIC_URL is missing.
For example: mirage.gigalixirapp.com
"""
config :mirage, MirageWeb.Endpoint,
http: [
port: String.to_integer(System.get_env("PORT") || "4000"),
transport_options: [socket_opts: [:inet6]]
],
secret_key_base: secret_key_base
url: [host: public_url, port: 443],
secret_key_base: secret_key_base,
server: true
# ## Using releases (Elixir v1.9+)
#
Loading…
Cancel
Save