slack_url_bot / Makefile
tonebeta's picture
chore: replace newspaper3k with newspaper4k to fix syntax warnings
ea984aa
# Makefile for managing the Slack URL Summarizer Bot Docker container
# --- Variables ---
IMAGE_NAME := slack-crawler-summary-bot
CONTAINER_NAME := slack-crawler-summary-bot_container
ENV_FILE := .env
# Hugging Face variables - **EDIT THESE**
HF_USERNAME := your-hf-username
HF_SPACE_NAME := your-hf-space-name
HF_IMAGE_NAME := registry.hf.space/$(HF_USERNAME)/$(HF_SPACE_NAME):latest
# --- Local Docker Management ---
# Build the Docker image
build:
docker build -t $(IMAGE_NAME) .
# Run the Docker container in detached mode
deploy:
docker run -d --name $(CONTAINER_NAME) --env-file $(ENV_FILE) -p 8000:8000 $(IMAGE_NAME)
# Stop the Docker container
stop:
docker stop $(CONTAINER_NAME)
# Remove the Docker container
rm:
docker rm $(CONTAINER_NAME)
# Restart the Docker container
restart: stop rm deploy
# Run the container in interactive mode for debugging
debug:
docker run -it --rm --name $(CONTAINER_NAME)-debug --env-file $(ENV_FILE) -p 8000:8000 $(IMAGE_NAME) /bin/bash
# Show logs of the running container
logs:
docker logs -f $(CONTAINER_NAME)
# --- Hugging Face Deployment ---
# Log in to Hugging Face Docker registry
hf-login:
@echo "You will be prompted for your Hugging Face username and a User Access Token with write permissions."
docker login registry.hf.space
# Tag the Docker image for Hugging Face
hf-tag:
docker tag $(IMAGE_NAME) $(HF_IMAGE_NAME)
# Update Hugging Face Space secrets from .env
hf-secrets:
uv run python scripts/set_hf_secrets.py --repo-id fongci/slack_url_bot
# Push the Docker image to Hugging Face Spaces
hf-push:
docker push $(HF_IMAGE_NAME)
# Build, tag, and push to Hugging Face
hf-deploy: build hf-tag hf-push
.PHONY: build deploy stop rm restart debug logs hf-login hf-tag hf-secrets hf-push hf-deploy