31 lines
808 B
Docker
31 lines
808 B
Docker
FROM python:3.11-slim
|
|
|
|
# Create user with standard UID/GID
|
|
RUN groupadd -g 100 hermesgroup 2>/dev/null || true && \
|
|
useradd -u 1026 -g 100 -m -s /bin/bash hermesuser 2>/dev/null || true
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies & curl for healthcheck
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY requirements.txt .
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY . .
|
|
|
|
# Ensure data directory permissions
|
|
RUN mkdir -p /app/data/personas /app/data/clones && \
|
|
chown -R 1026:100 /app
|
|
|
|
USER 1026:100
|
|
|
|
EXPOSE 8080
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD curl -fsS http://localhost:8080/api/health || exit 1
|
|
|
|
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"]
|