mirror of
https://github.com/anomalyco/opencode.git
synced 2026-04-24 23:04:55 +00:00
Replace complex Docker commands with simple Make targets for building, running, and managing the Discord bot container. This makes it easier for developers to get started without memorizing lengthy Docker flags. Also removes outdated CLAUDE.md and adds AGENTS.md files to guide AI agents working on conversation, database, actors, and sandbox modules.
34 lines
834 B
Makefile
34 lines
834 B
Makefile
IMAGE ?= opencode-discord:local
|
|
CONTAINER ?= opencode-discord-local
|
|
ENV_FILE ?= .env
|
|
DATA_DIR ?= data
|
|
HOST_PORT ?= 8787
|
|
|
|
.PHONY: docker-build docker-run docker-stop docker-restart docker-logs docker-status
|
|
|
|
docker-build:
|
|
docker build -t $(IMAGE) -f Dockerfile .
|
|
|
|
docker-run:
|
|
mkdir -p $(DATA_DIR)
|
|
docker rm -f $(CONTAINER) >/dev/null 2>&1 || true
|
|
docker run -d \
|
|
--name $(CONTAINER) \
|
|
--env-file $(ENV_FILE) \
|
|
-e DATABASE_PATH=/data/discord.sqlite \
|
|
-p $(HOST_PORT):8787 \
|
|
-v $(CURDIR)/$(DATA_DIR):/data \
|
|
$(IMAGE)
|
|
|
|
docker-stop:
|
|
docker stop $(CONTAINER) >/dev/null 2>&1 || true
|
|
docker rm $(CONTAINER) >/dev/null 2>&1 || true
|
|
|
|
docker-restart: docker-stop docker-run
|
|
|
|
docker-logs:
|
|
docker logs -f $(CONTAINER)
|
|
|
|
docker-status:
|
|
docker ps --filter "name=$(CONTAINER)" --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"
|