aegislm / services /worker /Dockerfile
ACA050's picture
Upload 57 files
f2c6053 verified
Raw
History Blame Contribute Delete
1.28 kB
# AegisLM Worker Service Dockerfile
# Multi-Agent Adversarial LLM Evaluation Framework
# Background job processing worker
FROM python:3.11-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1
ENV PIP_NO_CACHE_DIR=1
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
ca-certificates \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Create non-root user for security
RUN useradd -m -u 1000 aegislm && \
chown -R aegislm:aegislm /app
# Copy requirements first for better caching
COPY --chown=aegislm:aegislm requirements.txt .
# Install Python dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY --chown=aegislm:aegislm . .
# Make startup script executable
RUN chmod +x /app/start-worker.sh
# Switch to non-root user
USER aegislm
# No exposed ports - worker is internal service
# Health check - check worker status
HEALTHCHECK --interval=30s --timeout=10s --start-period=30s --retries=3 \
CMD ps aux | grep -v grep | grep worker || exit 1
# Run Worker service
CMD ["/app/start-worker.sh"]