not working but i am about to try something different.
This commit is contained in:
parent
ccd1ee7e4b
commit
0c9dda690d
3
.env
3
.env
@ -6,6 +6,9 @@
|
||||
# values for environment variables in the configuration file IF the variables
|
||||
# are not set in the shell environment.
|
||||
|
||||
EMAIL=consistentbayes@gmail.com
|
||||
DOMAIN_NAME=consistentbayes.com
|
||||
|
||||
# To override these values, set the shell environment variables.
|
||||
JUPYTERHUB_VERSION=0.9.4
|
||||
|
||||
|
6
Makefile
6
Makefile
@ -7,14 +7,12 @@ include .env
|
||||
|
||||
network:
|
||||
@docker network inspect $(DOCKER_NETWORK_NAME) >/dev/null 2>&1 || docker network create $(DOCKER_NETWORK_NAME)
|
||||
@docker network inspect traefik-network >/dev/null 2>&1 || docker network create traefik-network
|
||||
|
||||
volumes:
|
||||
@docker volume inspect $(DATA_VOLUME_HOST) >/dev/null 2>&1 || docker volume create --name $(DATA_VOLUME_HOST)
|
||||
@docker volume inspect $(DB_VOLUME_HOST) >/dev/null 2>&1 || docker volume create --name $(DB_VOLUME_HOST)
|
||||
|
||||
self-signed-cert:
|
||||
# make a self-signed cert
|
||||
|
||||
secrets/postgres.env:
|
||||
@echo "Generating postgres password in $@"
|
||||
@echo "POSTGRES_PASSWORD=$(shell openssl rand -hex 32)" > $@
|
||||
@ -49,7 +47,7 @@ userlist:
|
||||
# cert_files=
|
||||
#endif
|
||||
|
||||
check-files: userlist secrets/acme.json secrets/oauth.env secrets/postgres.env public_html/index.html
|
||||
check-files: userlist secrets/acme.json secrets/oauth.env secrets/postgres.env public_html/index.html traefik.toml
|
||||
|
||||
pull:
|
||||
docker pull $(DOCKER_NOTEBOOK_IMAGE)
|
||||
|
@ -16,6 +16,8 @@ services:
|
||||
- secrets/postgres.env
|
||||
volumes:
|
||||
- "db:${DB_VOLUME_CONTAINER}"
|
||||
networks:
|
||||
- traefik-network
|
||||
|
||||
hub:
|
||||
depends_on:
|
||||
@ -36,6 +38,11 @@ services:
|
||||
- "data:${DATA_VOLUME_CONTAINER}"
|
||||
ports:
|
||||
- "8000:8000"
|
||||
networks:
|
||||
- traefik-network
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.frontend.rule=Host:hub.docker.localhost"
|
||||
links:
|
||||
- hub-db
|
||||
environment:
|
||||
@ -56,6 +63,33 @@ services:
|
||||
command: >
|
||||
jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
|
||||
|
||||
reverse-proxy:
|
||||
image: traefik:latest
|
||||
container_name: reverse-proxy
|
||||
command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
|
||||
networks:
|
||||
- traefik-network
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
- 8080:8080
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ./traefik.toml:/traefik.toml
|
||||
- ./secrets/acme.json:/acme.json
|
||||
|
||||
|
||||
nginx:
|
||||
image: nginx:latest
|
||||
container_name: nginx
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.frontend.rule=Host:www.docker.localhost"
|
||||
networks:
|
||||
- traefik-network
|
||||
volumes:
|
||||
- ./public_html:/usr/share/nginx/html
|
||||
|
||||
volumes:
|
||||
data:
|
||||
external:
|
||||
@ -68,3 +102,5 @@ networks:
|
||||
default:
|
||||
external:
|
||||
name: ${DOCKER_NETWORK_NAME}
|
||||
traefik-network:
|
||||
external: true
|
||||
|
29
traefik.toml
Normal file
29
traefik.toml
Normal file
@ -0,0 +1,29 @@
|
||||
logLevel = "DEBUG"
|
||||
defaultEntryPoints = ["http", "https"]
|
||||
|
||||
[web]
|
||||
address = ":8080"
|
||||
|
||||
[docker]
|
||||
domain ="docker.localhost"
|
||||
watch = true
|
||||
|
||||
[entryPoints]
|
||||
[entryPoints.http]
|
||||
address = ":80"
|
||||
[entryPoints.http.redirect]
|
||||
entryPoint = "https"
|
||||
[entryPoints.https]
|
||||
address = ":443"
|
||||
[entryPoints.https.tls]
|
||||
|
||||
[acme]
|
||||
email="consistentbayes@gmail.com"
|
||||
storage="acme.json"
|
||||
entryPoint="https"
|
||||
acmeLogging=true
|
||||
onDemand=true
|
||||
OnHostRule=true
|
||||
|
||||
[acme.httpChallenge]
|
||||
entryPoint = "http"
|
Loading…
Reference in New Issue
Block a user