mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-09-20 10:05:57 +08:00
Add customizable configuration script to release (#2295)
This commit is contained in:
parent
b603639b77
commit
6406e1fcf7
|
@ -349,6 +349,11 @@ When clustering is enabled, you must additionally set the following env vars:
|
|||
`LIVEBOOK_DISTRIBUTION` is automatically set to `name` if clustering is
|
||||
enabled.
|
||||
|
||||
Some variables, like `LIVEBOOK_NODE`, are oftentimes computed at runtime.
|
||||
When using the Livebook Docker image, you can create a file at `/app/env.sh`
|
||||
that exports the necessary environment variables. This file is invoked right
|
||||
before booting Livebook.
|
||||
|
||||
## Development
|
||||
|
||||
Livebook is primarily a Phoenix web application and can be setup as such:
|
||||
|
|
|
@ -130,16 +130,12 @@ defmodule Livebook.Hubs.Dockerfile do
|
|||
|
||||
""" <>
|
||||
~S"""
|
||||
# Custom startup script to cluster multiple Livebook nodes on Fly.io
|
||||
# Runtime configuration to cluster multiple Livebook nodes on Fly.io
|
||||
RUN printf '\
|
||||
#!/bin/bash\n\
|
||||
export ERL_AFLAGS="-proto_dist inet6_tcp"\n\
|
||||
export LIVEBOOK_NODE="${FLY_APP_NAME}-${FLY_IMAGE_REF##*-}@${FLY_PRIVATE_IP}"\n\
|
||||
export LIVEBOOK_CLUSTER="dns:${FLY_APP_NAME}.internal"\n\
|
||||
/app/bin/livebook start\n\
|
||||
' > /app/bin/start.sh && chmod +x /app/bin/start.sh
|
||||
|
||||
CMD [ "sh", "-c", "/app/bin/start.sh" ]
|
||||
' > /app/env.sh
|
||||
"""
|
||||
end
|
||||
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
if exist "!RELEASE_ROOT!\env.bat" (
|
||||
call "!RELEASE_ROOT!\env.bat"
|
||||
)
|
||||
|
||||
set RELEASE_MODE=interactive
|
||||
if defined LIVEBOOK_NODE set RELEASE_NODE="!LIVEBOOK_NODE!"
|
||||
if not defined RELEASE_NODE set RELEASE_NODE=livebook_server
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
if [ -f "${RELEASE_ROOT}/env.sh" ]; then
|
||||
. "${RELEASE_ROOT}/env.sh"
|
||||
fi
|
||||
|
||||
export RELEASE_MODE=interactive
|
||||
export RELEASE_NODE=${LIVEBOOK_NODE:-${RELEASE_NODE:-livebook_server}}
|
||||
if [ -z "${LIVEBOOK_CLUSTER}" ]; then DISTRIBUTION_DEFAULT="sname"; else DISTRIBUTION_DEFAULT="name"; fi
|
||||
|
|
Loading…
Reference in a new issue