forked from jupyterlab-contrib/jupyterlab-logout
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
91214bb
commit e8fd41e
Showing
4 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# MAKEFILE SETTINGS | ||
# Silence default command echoing | ||
.SILENT: | ||
# Use one shell for all commands in a target recipe | ||
.ONESHELL: | ||
.EXPORT_ALL_VARIABLES: | ||
# Set phony targets | ||
.PHONY: help build up down | ||
# Set default goal | ||
.DEFAULT_GOAL := help | ||
# Use bash shell in Makefile instead of sh | ||
SHELL = /bin/bash | ||
|
||
build: ## Build docker image | ||
docker compose build | ||
|
||
up: build ## Run docker compose service | ||
docker compose up -d | ||
sleep 3 | ||
echo "open http://127.0.0.1:8888/lab" | ||
bash -c "open http://127.0.0.1:8888/lab" | ||
sleep 2 | ||
docker logs -n 1000 -f jupyterlab-logout | ||
|
||
down: ## Stop docker compose service | ||
docker compose down | ||
docker compose down --volumes | ||
|
||
rebuild: down up ## Rebuild docker compose service | ||
|
||
# Display target comments in 'make help' | ||
help: ## Show this help | ||
grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
version: "3.9" | ||
|
||
services: | ||
jupyterlab: | ||
image: jupyterlab-logout | ||
build: | ||
context: "." | ||
dockerfile: setup/Dockerfile | ||
container_name: jupyterlab-logout | ||
restart: always | ||
ports: | ||
- 8888:8888 | ||
environment: | ||
WORKBENCH_APP_ENABLED: 'true' | ||
# WORKBENCH_APP_ENABLED: 'false' | ||
volumes: | ||
- "${PWD}:/home/jovyan/jupyterlab-logout" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
FROM jupyter/minimal-notebook:lab-4.0.7 | ||
|
||
USER root | ||
|
||
RUN set -x \ | ||
&& apt-get update \ | ||
&& apt-get install -y curl vim less | ||
|
||
# setup package, enable classic extension, build lab extension | ||
USER "${NB_USER}" | ||
|
||
RUN set -x \ | ||
&& mamba install -q -c conda-forge -y jupyter-server-proxy \ | ||
&& fix-permissions /opt/conda | ||
|
||
WORKDIR "${HOME}/jupyterlab-logout" | ||
COPY . . | ||
RUN set -x \ | ||
&& python3 -m pip install "${HOME}/jupyterlab-logout" \ | ||
&& fix-permissions /opt/conda | ||
|
||
WORKDIR "${HOME}" | ||
RUN jupyter server extension enable --sys-prefix jupyter_server_proxy | ||
RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements" | ||
|
||
# copy configs, update permissions as root | ||
USER root | ||
RUN rm -rf "${HOME}/jupyterlab-logout" | ||
RUN cp /etc/jupyter/jupyter_server_config.py /etc/jupyter/jupyter_server_config_base.py | ||
COPY setup/jupyter_server_config.py /etc/jupyter/jupyter_server_config.py | ||
RUN fix-permissions /etc/jupyter | ||
|
||
USER "${NB_USER}" | ||
WORKDIR "${HOME}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
c = get_config() # noqa | ||
|
||
# load base config | ||
load_subconfig("/etc/jupyter/jupyter_server_config_base.py") # noqa | ||
|
||
# supports iframe and samesite cookies | ||
c.ServerApp.tornado_settings = { | ||
"headers": {"Content-Security-Policy": "frame-ancestors 'self' *"}, | ||
"cookie_options": {"SameSite": "None", "Secure": True}, | ||
} | ||
c.ServerApp.allow_root = True | ||
c.ServerApp.allow_origin = "*" | ||
|
||
c.IdentityProvider.token = "" | ||
# c.ServerApp.default_url = "/lab" |