File size: 1,011 Bytes
e5d4b6d
 
 
 
de03264
e5d4b6d
 
 
de03264
 
e5d4b6d
de03264
e5d4b6d
de03264
e5d4b6d
de03264
e5d4b6d
de03264
e5d4b6d
 
 
 
 
 
 
de03264
 
 
 
 
e5d4b6d
 
de03264
e5d4b6d
 
 
de03264
 
e5d4b6d
 
de03264
e5d4b6d
 
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
# Python environment
PROJECT_ROOT = $(shell pwd)
VENV = $(PROJECT_ROOT)/.venv
PYTHON_ENV = $(VENV)/bin/python

# Docker image and container names for the student demo
IMAGE_NAME = streamlit-student-demo
CONTAINER_NAME = streamlit-student-demo-container
PORT = 8501

.PHONY: build run run-detached stop clean up restart

# Build the Docker image using Dockerfile.simple
build:
	docker build -f Dockerfile.simple -t $(IMAGE_NAME) .

# Run the Docker container interactively (foreground)
run:
	docker run --rm -it \
		--name $(CONTAINER_NAME) \
		-p $(PORT):8501 \
		$(IMAGE_NAME)

# Run the Docker container in detached mode (background)
run-detached:
	docker run -d \
		--name $(CONTAINER_NAME) \
		-p $(PORT):8501 \
		$(IMAGE_NAME)

# Stop the running container
stop:
	docker stop $(CONTAINER_NAME) || true

# Remove the container (if stopped)
clean:
	docker rm $(CONTAINER_NAME) || true

# Build and run in one command (detached)
up: build run-detached

# Stop, remove, rebuild, and run
restart: stop clean up