Phoenix Secrets

The last step is to create a file or files to hold secret configs. When you create a phoenix project, this is generated for you and added to .gitignore.

You should still be switched to the builder user. Create a config directory.

mkdir ~/config

Create a prod secret config. Replace "example" with the proper name of your project. Replace the db name and password with the db name and db user password you created in the last chapter.

/home/builder/config/prod.secret.exs

use Mix.Config config :example, Example.Endpoint, secret_key_base: "SECRET_KEY" config :example, Example.Repo, adapter: Ecto.Adapters.Postgres, username: "web", password: "password", database: "example_prod", pool_size: 20

For reasons discussed later, you'll need to copy this to a stage config as well.

cp /home/builder/config/prod.secret.exs /home/builder/config/stage.secret.exs

Leave that for now. You can edit it later.

results matching ""

    No results matching ""