Add Docker compose templates and configurations
This commit is contained in:
49
docker-templates/jupyter/.env
Normal file
49
docker-templates/jupyter/.env
Normal file
@@ -0,0 +1,49 @@
|
||||
# #######################################################
|
||||
# Templating variables, not used by compose file directly
|
||||
SERVER_NAME=
|
||||
SERVER_IP=
|
||||
SUBDOMAIN=
|
||||
SERVICE_NAME=jupyter
|
||||
ICON_URL=https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/${SERVICE_NAME}.svg
|
||||
|
||||
# Include Server Name in Proxy URL? Choose one.
|
||||
|
||||
# PROXY_URL=${SERVICE_NAME}.${SERVER_NAME}.${SUBDOMAIN}.duckdns.org
|
||||
PROXY_URL=${SERVICE_NAME}.${SUBDOMAIN}.duckdns.org
|
||||
|
||||
|
||||
# #############################################################################
|
||||
# Compose file variables
|
||||
|
||||
TZ=America/New_York
|
||||
PUID=1000
|
||||
PGID=1000
|
||||
|
||||
CONTAINER_NAME=${SERVICE_NAME}
|
||||
INTERNAL_PORT=8888
|
||||
EXTERNAL_PORT=8890
|
||||
LOCAL_URL=http://${SERVER_IP}:${EXTERNAL_PORT}
|
||||
|
||||
JUPYTER_TOKEN=Tiberi0u$
|
||||
|
||||
|
||||
# #############################################################
|
||||
# Container Labels
|
||||
|
||||
# DO NOT enclose label values in single quotes
|
||||
# If the value needs to include single quotes use backticks instead
|
||||
|
||||
# For example HOST_LABEL=traefik.http.routers.${SERVICE_NAME}.rule=Host(`${PROXY_URL}`)
|
||||
# Notice the use of backticks instead of single quotes around ${PROXY_URL}
|
||||
|
||||
TRAEFIK_ENABLE_LABEL=traefik.enable=true
|
||||
HOST_LABEL=traefik.http.routers.${SERVICE_NAME}.rule=Host(`${PROXY_URL}`)
|
||||
ICON_LABEL=com.getarcaneapp.arcane.icon=${ICON_URL}
|
||||
LOADBALANCER_LABEL=traefik.http.services.${SERVICE_NAME}.loadbalancer.server.port=${INTERNAL_PORT}
|
||||
|
||||
TRAEFIK_NETWORK_LABEL=traefik.docker.network=traefik-network
|
||||
ENTRYPOINT_LABEL=traefik.http.routers.${SERVICE_NAME}.entrypoints=websecure
|
||||
CERT_LABEL=traefik.http.routers.${SERVICE_NAME}.tls.certresolver=letsencrypt
|
||||
|
||||
AUTHELIA_LABEL=traefik.http.routers.${SERVICE_NAME}.middlewares=authelia@docker
|
||||
WATCHTOWER_ENABLE_LABEL=com.centurylinklabs.watchtower.enable=true
|
||||
52
docker-templates/jupyter/docker-compose.yml
Normal file
52
docker-templates/jupyter/docker-compose.yml
Normal file
@@ -0,0 +1,52 @@
|
||||
services:
|
||||
jupyter:
|
||||
image: jupyter/scipy-notebook:latest
|
||||
container_name: jupyter
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
- homelab-network
|
||||
- traefik-network
|
||||
ports:
|
||||
- ${EXTERNAL_PORT}:${INTERNAL_PORT}
|
||||
volumes:
|
||||
- ./config/jupyter:/home/jovyan/work
|
||||
environment:
|
||||
- JUPYTER_ENABLE_LAB=yes
|
||||
- GRANT_SUDO=yes
|
||||
user: root
|
||||
command: start-notebook.sh --NotebookApp.token='${JUPYTER_TOKEN}'
|
||||
# Uncomment for GPU support (NVIDIA, requires nvidia-container-toolkit)
|
||||
# runtime: nvidia
|
||||
# devices:
|
||||
# - /dev/nvidia0:/dev/nvidia0
|
||||
# - /dev/nvidiactl:/dev/nvidiactl
|
||||
# Add these to environment above:
|
||||
# - NVIDIA_VISIBLE_DEVICES=all
|
||||
# - NVIDIA_DRIVER_CAPABILITIES=compute,utility
|
||||
labels:
|
||||
- ${ICON_LABEL}
|
||||
- ${HOST_LABEL}
|
||||
- ${LOADBALANCER_LABEL}
|
||||
- ${WATCHTOWER_ENABLE_LABEL}
|
||||
- ${TRAEFIK_ENABLE_LABEL}
|
||||
- ${TRAEFIK_NETWORK_LABEL}
|
||||
- ${ENTRYPOINT_LABEL}
|
||||
- ${CERT_LABEL}
|
||||
- ${AUTHELIA_LABEL}
|
||||
|
||||
networks:
|
||||
homelab-network:
|
||||
external: true
|
||||
traefik-network:
|
||||
external: true
|
||||
|
||||
x-dockge:
|
||||
urls:
|
||||
- https://${PROXY_URL}
|
||||
- ${LOCAL_URL}
|
||||
|
||||
x-arcane:
|
||||
icon: ${ICON_URL}
|
||||
urls:
|
||||
- https://${PROXY_URL}
|
||||
- ${LOCAL_URL}
|
||||
Reference in New Issue
Block a user