Add Makefile
`make build` builds the image, including network and volumes, and pulling the notebook image. This removes the number of manual steps to get started.
This commit is contained in:
parent
f5453b21a6
commit
d3a51902ae
@ -9,9 +9,9 @@ RUN /opt/conda/bin/pip install \
|
|||||||
dockerspawner==0.3.*
|
dockerspawner==0.3.*
|
||||||
|
|
||||||
# Copy TLS certificate and key
|
# Copy TLS certificate and key
|
||||||
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.cer
|
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt
|
||||||
ENV SSL_KEY /srv/jupyterhub/secrets/jupyterhub.key
|
ENV SSL_KEY /srv/jupyterhub/secrets/jupyterhub.key
|
||||||
COPY ./secrets/*.cer $SSL_CERT
|
COPY ./secrets/*.crt $SSL_CERT
|
||||||
COPY ./secrets/*.key $SSL_KEY
|
COPY ./secrets/*.key $SSL_KEY
|
||||||
RUN chmod 700 /srv/jupyterhub/secrets && \
|
RUN chmod 700 /srv/jupyterhub/secrets && \
|
||||||
chmod 600 /srv/jupyterhub/secrets/*
|
chmod 600 /srv/jupyterhub/secrets/*
|
||||||
|
40
Makefile
Normal file
40
Makefile
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
include .env
|
||||||
|
|
||||||
|
.DEFAULT_GOAL=build
|
||||||
|
|
||||||
|
network:
|
||||||
|
@docker network inspect $(DOCKER_NETWORK_NAME) >/dev/null 2>&1 || docker network create $(DOCKER_NETWORK_NAME)
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
@docker volume inspect $(DATA_VOLUME_HOST) >/dev/null 2>&1 || docker volume create --name $(DATA_VOLUME_HOST)
|
||||||
|
|
||||||
|
self-signed-cert:
|
||||||
|
# make a self-signed cert
|
||||||
|
|
||||||
|
secrets/jupyterhub.crt:
|
||||||
|
@echo "Need an SSL certificate in secrets/jupyterhub.crt"
|
||||||
|
@exit 1
|
||||||
|
|
||||||
|
secrets/jupyterhub.key:
|
||||||
|
@echo "Need an SSL key in secrets/jupyterhub.key"
|
||||||
|
@exit 1
|
||||||
|
|
||||||
|
userlist:
|
||||||
|
@echo "Add usernames, one per line, to ./userlist, such as:"
|
||||||
|
@echo " zoe admin"
|
||||||
|
@echo " wash"
|
||||||
|
@exit 1
|
||||||
|
|
||||||
|
check-files: secrets/jupyterhub.crt secrets/jupyterhub.key userlist
|
||||||
|
# fail in an informative way if files don't exist
|
||||||
|
|
||||||
|
pull:
|
||||||
|
docker pull $(DOCKER_NOTEBOOK_IMAGE)
|
||||||
|
|
||||||
|
build: check-files pull network volumes
|
||||||
|
docker-compose build
|
||||||
|
|
||||||
|
up:
|
||||||
|
docker-compose up -d
|
||||||
|
|
||||||
|
.PHONY: network volumes check-files build up
|
Loading…
Reference in New Issue
Block a user