livebook/config/runtime.exs
Jonatan Kłosko ac8e1e30f4
Setup Docker image with releases (#244)
* Setup Docker image with releases

* Support ip env variable and use it for Docker deployment

* Autofocus auth forms

* Rename ip env var

* Update option lists

* Make distribution cookie configurable

* Update README.md

Co-authored-by: José Valim <jose.valim@dashbit.co>

* Include git in the final image

* Remove unnecessary build dependency

* Improve file permissions handling and add more comments

* Use namespaced home directory

* Update README with all running options

* Update base image

* Reference official Docker image in the README

Co-authored-by: José Valim <jose.valim@dashbit.co>
2021-04-27 16:34:02 +02:00

28 lines
823 B
Elixir

import Config
require Logger
config :livebook, LivebookWeb.Endpoint,
secret_key_base:
Livebook.Config.secret!("LIVEBOOK_SECRET_KEY_BASE") ||
Base.encode64(:crypto.strong_rand_bytes(48))
config :livebook, :root_path, Livebook.Config.root_path!("LIVEBOOK_ROOT_PATH")
if password = Livebook.Config.password!("LIVEBOOK_PASSWORD") do
config :livebook, authentication_mode: :password, password: password
else
config :livebook, token: Livebook.Utils.random_id()
end
if port = Livebook.Config.port!("LIVEBOOK_PORT") do
config :livebook, LivebookWeb.Endpoint, http: [port: port]
end
if ip = Livebook.Config.ip!("LIVEBOOK_IP") do
config :livebook, LivebookWeb.Endpoint, http: [ip: ip]
end
config :livebook,
:cookie,
Livebook.Config.cookie!("LIVEBOOK_COOKIE") || Livebook.Utils.random_cookie()