feat(templates): add Docker deployment templates
This commit is contained in:
parent
5136411258
commit
efbdbd82ed
4 changed files with 208 additions and 0 deletions
33
scripts/templates/docker/Dockerfile
Normal file
33
scripts/templates/docker/Dockerfile
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# Agent Factory — Docker deployment template
|
||||
# Runs a Claude Code agent system in an isolated container.
|
||||
# Replace {{PROJECT_NAME}} and {{ANTHROPIC_API_KEY}} with real values
|
||||
# (or pass them at runtime via .env / docker compose env_file).
|
||||
|
||||
FROM node:22-slim
|
||||
|
||||
# Install Claude Code globally
|
||||
RUN npm install -g @anthropic-ai/claude-code
|
||||
|
||||
# Create a non-root agent user for security
|
||||
RUN useradd -m -s /bin/bash agent
|
||||
|
||||
WORKDIR /home/agent/project
|
||||
|
||||
# Copy project files (adjust to your project structure)
|
||||
COPY --chown=agent:agent . .
|
||||
|
||||
# Set up entrypoint script
|
||||
COPY --chown=agent:agent docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
|
||||
USER agent
|
||||
|
||||
# API key injected at runtime — never bake into image
|
||||
ENV ANTHROPIC_API_KEY={{ANTHROPIC_API_KEY}}
|
||||
|
||||
# Health check — entrypoint writes /tmp/agent-health on each beat
|
||||
HEALTHCHECK --interval=60s --timeout=10s --start-period=30s --retries=3 \
|
||||
CMD test -f /tmp/agent-health && \
|
||||
test $(( $(date +%s) - $(date +%s -r /tmp/agent-health 2>/dev/null || echo 0) )) -lt 300
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue