fix: update Dockerfile to clone agent source and add .dockerignore

This commit is contained in:
Ezra
2026-04-10 12:14:47 +00:00
parent e95f48b195
commit be3e8ea45c
3 changed files with 21 additions and 10 deletions

View File

@@ -1,31 +1,29 @@
# --- Build Stage ---
FROM python:3.11-slim AS builder
# Install build essentials and uv
ARG AGENT_REPO="https://forge.alexanderwhitestone.com/Timmy_Foundation/hermes-agent.git"
RUN apt-get update && apt-get install -y --no-install-recommends curl git build-essential cmake ca-certificates && curl -LsSf https://astral.sh/uv/install.sh | sh && rm -rf /var/lib/apt/lists/*
ENV PATH="/root/.local/bin:${PATH}"
WORKDIR /app
# Copy only dependency files first for caching
COPY pyproject.toml uv.lock* ./
# Clone the actual source code
RUN git clone ${AGENT_REPO} .
# Install dependencies using uv
RUN uv sync --frozen --no-install-project --no-dev
# --- Final Stage ---
FROM python:3.11-slim
# Install runtime dependencies
RUN apt-get update && apt-get install -y --no-install-recommends curl git socat ripgrep ffmpeg ca-certificates && rm -rf /var/lib/apt/lists/*
# Copy the virtual environment from builder
# Copy the virtual environment and the source from builder
COPY --from=builder /app/.venv /app/.venv
COPY --from=builder /app /app
ENV PATH="/app/.venv/bin:${PATH}"
WORKDIR /app
COPY . .
# Expose the gateway port (default)
EXPOSE 8643
# Run the gateway
ENTRYPOINT ["hermes", "gateway"]