43 lines
1.2 KiB
Docker
43 lines
1.2 KiB
Docker
FROM python:3.12-slim-bookworm AS base
|
|
|
|
# Install uv binary from official image
|
|
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
|
|
|
# Install system dependencies (ca-certificates, curl, bubblewrap for sandbox)
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
ca-certificates \
|
|
curl \
|
|
bubblewrap \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Configure Python and uv environment
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
PYTHONDONTWRITEBYTECODE=1 \
|
|
UV_COMPILE_BYTECODE=1 \
|
|
UV_LINK_MODE=copy \
|
|
PYTHONPATH="/app/src:/app:$PYTHONPATH"
|
|
|
|
# Copy dependency specifications first for Docker layer caching
|
|
COPY pyproject.toml uv.lock README.md ./
|
|
RUN uv sync --frozen --no-dev --no-install-project
|
|
|
|
# Copy application source code and resource files
|
|
COPY src/ ./src/
|
|
COPY extensions/ ./extensions/
|
|
COPY skills/ ./skills/
|
|
COPY main.py run.py ./
|
|
|
|
# Finalize project sync
|
|
RUN uv sync --frozen --no-dev
|
|
|
|
# Writable home directory for non-root container UID (used for mounted ~/.gemini)
|
|
RUN mkdir -p /homeagent && chmod 0777 /homeagent
|
|
|
|
# Use the virtual environment created by uv
|
|
ENV PATH="/app/.venv/bin:$PATH"
|
|
|
|
# Default command to run HomeAgent bot
|
|
CMD ["python", "run.py"]
|