Created
October 30, 2019 00:18
-
-
Save carlogilmar/242bbc5c4145a81a3b30aa78fd492d78 to your computer and use it in GitHub Desktop.
Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Steps | |
1. mix release.init | |
2. Create config/releases.exs | |
``` | |
import Config | |
secret_key_base = System.fetch_env!("SECRET_KEY_BASE") | |
app_port = System.fetch_env!("APP_PORT") | |
app_hostname = System.fetch_env!("APP_HOSTNAME") | |
db_user = System.fetch_env!("DB_USER") | |
db_password = System.fetch_env!("DB_PASSWORD") | |
db_host = System.fetch_env!("DB_HOST") | |
config :demo, DemoWeb.Endpoint, | |
http: [:inet6, port: String.to_integer(app_port)], | |
secret_key_base: secret_key_base | |
config :demo, | |
app_port: app_port | |
config :demo, | |
app_hostname: app_hostname | |
# Configure your database | |
config :demo, Demo.Repo, | |
username: db_user, | |
password: db_password, | |
database: "demo_prod", | |
hostname: db_host, | |
pool_size: 10 | |
``` | |
3. Create a .env file | |
``` | |
APP_PORT=4000 | |
APP_HOSTNAME=localhost | |
DB_USER=postgres | |
DB_PASSWORD=pass | |
DB_HOST=localhost | |
SECRET_KEY_BASE=Y0uRvErYsecr3TANDL0ngStr1ng | |
``` | |
4. modify config/prod.ex | |
``` | |
config :demo, DemoWeb.Endpoint, server: true | |
``` | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment