Last active
March 10, 2020 15:14
-
-
Save garystafford/da897359cb152c164999491f0b0e419f to your computer and use it in GitHub Desktop.
Jupyter Notebook and PostgreSQL Stack
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
# 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