-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
46 lines (41 loc) · 1.01 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
SHELL := /bin/bash
PROJECT_NAME ?= fittex
HOST_USER ?= $(shell whoami)
DATA_PATH ?= $(shell pwd)/data
.PHONY: build shell notebook
# Build the Docker image
build:
docker build \
-t $(PROJECT_NAME) \
-f devops/Dockerfile \
.
# Run an interactive shell in the container
shell: build
docker run --rm -it \
-e HOME=/home/$(HOST_USER) \
--name $(PROJECT_NAME)-container \
-v $(shell pwd):/opt/project \
-v $(DATA_PATH):/data \
--privileged \
--network host \
$(PROJECT_NAME) bash
# Run the container (non-interactive)
run: build
docker run --rm \
--name $(PROJECT_NAME)-container \
$(PROJECT_NAME)
# Run a Jupyter notebook server in the container
notebook: build
docker run --rm -it \
-e HOME=/home/$(HOST_USER) \
--name $(PROJECT_NAME)-notebook \
-v $(shell pwd):/opt/project \
-v $(DATA_PATH):/data \
--privileged \
--network host \
-p 8888:8888 \
$(PROJECT_NAME) \
jupyter server \
--ServerApp.ip=0.0.0.0 \
--ServerApp.root_dir=/home/$(HOST_USER) \
--ServerApp.token='fittex'