Skip to content

Commit

Permalink
Update airgapped Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Aug 8, 2023
1 parent e9ab9de commit 4eaea18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ The following environment variables can be used to configure Livebook on boot:
cluster. Must be "name" (long names) or "sname" (short names). Note that this
sets RELEASE_DISTRIBUTION if present when creating a release. Defaults to "sname".

* LIVEBOOK_FORCE_SSL_HOST - sets a host to redirect to if the request is not over HTTP.
* LIVEBOOK_FORCE_SSL_HOST - sets a host to redirect to if the request is not over HTTPS.
Note it does not apply when accessing Livebook via localhost. Defaults to nil.

* LIVEBOOK_HOME - sets the home path for the Livebook instance. This is the
Expand Down Expand Up @@ -264,8 +264,8 @@ The following environment variables can be used to configure Livebook on boot:
Must be set together with LIVEBOOK_TEAMS_NAME and LIVEBOOK_TEAMS_KEY.

* LIVEBOOK_TEAMS_SECRETS - sets the Livebook Teams encrypted secrets for deploying apps with secrets.
This is relevant when deploying apps with offline hub. Must be set together with
LIVEBOOK_TEAMS_NAME, LIVEBOOK_TEAMS_KEY and LIVEBOOK_TEAMS_OFFLINE_KEY.
This is relevant when deploying airgapped apps. Must be set together with
LIVEBOOK_TEAMS_NAME, LIVEBOOK_TEAMS_KEY, and LIVEBOOK_TEAMS_OFFLINE_KEY.

* LIVEBOOK_TOKEN_ENABLED - controls whether token authentication is enabled.
Enabled by default unless LIVEBOOK_PASSWORD is set. Set it to "false" to
Expand Down
25 changes: 15 additions & 10 deletions lib/livebook_web/live/hub/edit/team_component.ex
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,9 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
<p class="text-gray-700">
Then save the Dockerfile below in a repository with the Livebook notebooks
that belong to your Organization. <strong>You must change</strong>
<code>/path/to/my/notebooks</code> in the template below to point to a directory
with all <code>.livemd</code> files you want to deploy.
the value of the <code>APPS_PATH</code>
argument in the template below to point to a directory with all <code>.livemd</code>
files you want to deploy.
</p>
<div id="env-code" class="py-2">
Expand Down Expand Up @@ -239,18 +240,19 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
</div>
<p class="text-gray-700 py-2">
Finally, you must set the following environment variables in your deployment platform:
You may additionally perform the following optional steps:
</p>
<ul class="text-gray-700 pl-1 space-y-3 list-disc list-inside">
<li>
<code>LIVEBOOK_TEAMS_KEY</code>
- set it to the "Livebook Teams key" value you can find at the top of this page
you may remove the default value for <code>TEAMS_KEY</code>
from your Dockerfile and set it as a build argument in your deployment
platform
</li>
<li>
<code>LIVEBOOK_PASSWORD</code>
(optional) - set it to any value of your choice, if you want to access and debug
your deployed notebooks in production
if you want to debug your deployed notebooks in production, you may
set the <code>LIVEBOOK_PASSWORD</code> environment variable with a
value of at least 12 characters of your choice
</li>
</ul>
</div>
Expand Down Expand Up @@ -455,8 +457,10 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
base =
"""
FROM ghcr.io/livebook-dev/livebook:#{version}
ARG APPS_PATH /path/to/my/notebooks
ARG TEAMS_KEY "#{socket.assigns.hub.teams_key}"
ENV LIVEBOOK_APPS_PATH_HUB_ID "#{socket.assigns.hub.id}"
ENV LIVEBOOK_TEAMS_KEY ${TEAMS_KEY}
ENV LIVEBOOK_TEAMS_NAME "#{socket.assigns.hub.hub_name}"
ENV LIVEBOOK_TEAMS_OFFLINE_KEY "#{socket.assigns.hub.org_public_key}"
ENV LIVEBOOK_TEAMS_SECRETS "#{encrypt_secrets_to_dockerfile(socket)}"
Expand All @@ -465,9 +469,10 @@ defmodule LivebookWeb.Hub.Edit.TeamComponent do
apps =
"""
COPY /path/to/my/notebooks /apps
ENV LIVEBOOK_APPS_PATH "/apps"
ENV LIVEBOOK_APPS_PATH_WARMUP "manual"
ENV LIVEBOOK_APPS_PATH_HUB_ID "#{socket.assigns.hub.id}"
COPY ${APPS_PATH} /apps
RUN /app/bin/warmup_apps.sh\
"""

Expand Down

0 comments on commit 4eaea18

Please sign in to comment.