Pokedex / Makefile
PabloRR10Apple's picture
Updated URL option
e5d4b6d unverified
# 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