From 735d3633556a4977c4e6c3a929cfd0ec24a93bf2 Mon Sep 17 00:00:00 2001 From: 3wc <3wc@doesthisthing.work> Date: Sun, 21 Nov 2021 22:15:44 +0200 Subject: [PATCH] refactor: split out Voila into separate compose file --- .env.sample | 5 ++++- compose.voila.yml | 39 +++++++++++++++++++++++++++++++++++++++ compose.yml | 43 +------------------------------------------ 3 files changed, 44 insertions(+), 43 deletions(-) create mode 100644 compose.voila.yml diff --git a/.env.sample b/.env.sample index 9054aca..986a948 100644 --- a/.env.sample +++ b/.env.sample @@ -8,6 +8,9 @@ COMPOSE_FILE="compose.yml" #EXTRA_DOMAINS=', `www.jupyter-lab.example.com`' LETS_ENCRYPT_ENV=production -# SSH access +# SSH authentication for git operations #SECRET_SSH_KEY_VERSION=v1 #COMPOSE_FILE="$COMPOSE_FILE:compose.ssh.yml" + +# "Voila" notebook publishing +#COMPOSE_FILE="$COMPOSE_FILE:compose.voila.yml" diff --git a/compose.voila.yml b/compose.voila.yml new file mode 100644 index 0000000..475ae12 --- /dev/null +++ b/compose.voila.yml @@ -0,0 +1,39 @@ +--- +version: "3.8" + +services: + voila: + image: jupyter/datascience-notebook:r-4.1.1 + networks: + - proxy + environment: + - JUPYTER_ENABLE_LAB=yes + volumes: + - jupyter_data:/home/jovyan + command: > + bash -c + " + pip install ipywidgets jupyterlab-git voila && + voila --enable_nbextensions=True --autoreload=True --Voila.ip=0.0.0.0 --TagRemovePreprocessor.remove_cell_tags='{\"hide\"}' --no-browser --MappingKernelManager.cull_interval=60 --MappingKernelManager.cull_idle_timeout=120 + " + + configs: + - source: install-packages_conf + target: /usr/local/bin/start-notebook.d/install-packages + mode: 0555 + deploy: + restart_policy: + condition: on-failure + labels: + - "traefik.enable=true" + - "traefik.http.services.${STACK_NAME}_voila.loadbalancer.server.port=8866" + - "traefik.http.routers.${STACK_NAME}_voila.rule=Host(`dashboard.${DOMAIN}`)" + - "traefik.http.routers.${STACK_NAME}_voila.entrypoints=web-secure" + - "traefik.http.routers.${STACK_NAME}_voila.tls.certresolver=${LETS_ENCRYPT_ENV}" + # healthcheck: + # test: ["CMD", "curl", "-f", "http://localhost"] + # interval: 30s + # timeout: 10s + # retries: 10 + # start_period: 1m + diff --git a/compose.yml b/compose.yml index 771e919..f2f1e5d 100644 --- a/compose.yml +++ b/compose.yml @@ -33,49 +33,8 @@ services: # timeout: 10s # retries: 10 # start_period: 1m - # + - voila: - image: jupyter/datascience-notebook:r-4.1.1 - networks: - - proxy - environment: - - JUPYTER_ENABLE_LAB=yes - volumes: - - jupyter_data:/home/jovyan - command: > - bash -c - " - pip install ipywidgets jupyterlab-git voila && - voila \ - --enable_nbextensions=True \ - --autoreload=True \ - --Voila.ip=0.0.0.0 \ - --no-browser \ - --MappingKernelManager.cull_interval=60 \ - --MappingKernelManager.cull_idle_timeout=120 - " - - configs: - - source: install-packages_conf - target: /usr/local/bin/start-notebook.d/install-packages - mode: 0555 - deploy: - restart_policy: - condition: on-failure - labels: - - "traefik.enable=true" - - "traefik.http.services.${STACK_NAME}_voila.loadbalancer.server.port=8866" - - "traefik.http.routers.${STACK_NAME}_voila.rule=Host(`dashboard.${DOMAIN}`)" - - "traefik.http.routers.${STACK_NAME}_voila.entrypoints=web-secure" - - "traefik.http.routers.${STACK_NAME}_voila.tls.certresolver=${LETS_ENCRYPT_ENV}" - # healthcheck: - # test: ["CMD", "curl", "-f", "http://localhost"] - # interval: 30s - # timeout: 10s - # retries: 10 - # start_period: 1m - volumes: jupyter_data: