Skip to content

Instantly share code, notes, and snippets.

@garystafford
Last active March 10, 2020 15:14
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save garystafford/da897359cb152c164999491f0b0e419f to your computer and use it in GitHub Desktop.
Jupyter Notebook and PostgreSQL Stack
# docker stack deploy -c stack.yml jupyter
# optional pgadmin container
version: "3.7"
networks:
demo-net:
services:
spark:
image: jupyter/all-spark-notebook:latest
ports:
- "8888:8888/tcp"
- "4040:4040/tcp"
networks:
- demo-net
working_dir: /home/$USER/work
environment:
CHOWN_HOME: "yes"
GRANT_SUDO: "yes"
NB_UID: 1000
NB_GID: 100
NB_USER: $USER
NB_GROUP: staff
user: root
deploy:
replicas: 1
restart_policy:
condition: on-failure
volumes:
- $PWD/work:/home/$USER/work
postgres:
image: postgres:12-alpine
environment:
POSTGRES_USERNAME: postgres
POSTGRES_PASSWORD: postgres1234
POSTGRES_DB: bakery
ports:
- "5432:5432/tcp"
networks:
- demo-net
volumes:
- $HOME/data/postgres:/var/lib/postgresql/data
deploy:
restart_policy:
condition: on-failure
adminer:
image: adminer:latest
ports:
- "8080:8080/tcp"
networks:
- demo-net
deploy:
restart_policy:
condition: on-failure
# pgadmin:
# image: dpage/pgadmin4:latest
# environment:
# PGADMIN_DEFAULT_EMAIL: user@domain.com
# PGADMIN_DEFAULT_PASSWORD: 5up3rS3cr3t!
# ports:
# - "8180:80/tcp"
# networks:
# - demo-net
# deploy:
# restart_policy:
# condition: on-failure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment