Skip to content

Commit 5bb7f5a

Browse files
Add justfile docker features
Clean build, SSH, and error handling. More granular container naming in docker-compose.yml
1 parent d31c8a5 commit 5bb7f5a

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

jupyter/README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,16 +61,22 @@ Udacity course on data science.
6161
# help
6262
just
6363
64+
# build image locally (no-cache)
65+
just build-clean
66+
6467
# build image locally
6568
just build
6669
6770
# start container
6871
just start
6972
73+
# ssh
74+
just exec
75+
7076
# stop container
7177
just stop
7278
73-
# remove container and network
79+
# stop container, remove container and network
7480
just down
7581
```
7682

@@ -82,7 +88,8 @@ Udacity course on data science.
8288
* Run cells by selecting them and pressing `shift-enter`
8389

8490
## TODO
85-
* Get Jupyter working in [VSCode](https://github.com/microsoft/vscode-jupyter)
91+
* ~~Get Jupyter working in [VSCode](https://github.com/microsoft/vscode-jupyter)~~
92+
* Multiple `localhost` entries in `/etc/hosts` 😭
8693

8794
## Further Reading
8895
[Original Repo](https://github.com/pythoninthegrass/wine_quality)

jupyter/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
version: "3.9"
22

33
services:
4-
jupyter:
4+
app:
5+
container_name: winequality
56
image: jupyter/minimal-notebook:latest
67
tty: true # false for `entrypoint` in Dockerfile
78
stdin_open: true # false for `entrypoint` in Dockerfile

jupyter/justfile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@ host := `uname -a`
66
default:
77
just --list
88

9-
build:
9+
build-clean:
1010
docker-compose build --pull --no-cache
1111

12+
build:
13+
docker-compose build --pull
14+
1215
start:
1316
docker-compose up -d
1417

18+
exec:
19+
docker-compose exec app bash
20+
1521
stop:
1622
docker-compose stop
1723

1824
down:
19-
docker-compose down
25+
docker-compose stop && docker-compose down --remove-orphans

0 commit comments

Comments
 (0)