forked from SafeRL-Lab/cheetahclaws
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
56 lines (44 loc) · 2 KB
/
Dockerfile
File metadata and controls
56 lines (44 loc) · 2 KB
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
47
48
49
50
51
52
53
54
55
56
# CheetahClaws — server image (Web UI + bridges)
#
# Targets headless deployments: home server, cloud VM, container hosts.
# Default CMD launches the web UI on 0.0.0.0:8080; configured Telegram /
# WeChat / Slack bridges auto-start in the same process.
#
# Build: docker build -t cheetahclaws:latest .
# Compose: see docker-compose.yml
FROM python:3.13-slim AS runtime
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1
# git: occasionally invoked by the agent for status/log inside /workspace.
# tini: PID-1 signal handling (clean Ctrl-C / docker stop).
RUN apt-get update \
&& apt-get install -y --no-install-recommends git tini \
&& rm -rf /var/lib/apt/lists/*
# Non-root user. UID 1000 matches the typical first Linux user; override at
# runtime with `--user "${UID}:${GID}"` when host UIDs differ so files
# written into mounted /workspace remain owner-readable on the host.
RUN useradd --create-home --uid 1000 --shell /bin/bash cheetah
WORKDIR /opt/cheetahclaws
COPY --chown=cheetah:cheetah pyproject.toml requirements.txt ./
COPY --chown=cheetah:cheetah . .
# Install with the [web] extra so chat-UI deps (sqlalchemy, bcrypt, PyJWT)
# are present. Use editable install so version metadata + entry point match
# the source tree.
RUN pip install --no-cache-dir -e '.[web]'
USER cheetah
# Persist config, sessions, history. Mount this in compose to survive
# container recreation.
VOLUME ["/home/cheetah/.cheetahclaws"]
# Workspace where the agent reads/writes files. Mount your project from
# the host onto this path.
WORKDIR /workspace
EXPOSE 8080
# Healthcheck: web server's /api/config returns 200 once it's up.
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD python -c "import urllib.request,sys; \
sys.exit(0 if urllib.request.urlopen('http://127.0.0.1:8080/api/config', timeout=3).status == 200 else 1)" \
|| exit 1
ENTRYPOINT ["/usr/bin/tini", "--", "cheetahclaws"]
CMD ["--web", "--host", "0.0.0.0", "--port", "8080"]