Include full contents of all nested repositories
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
74
letsbe-sysadmin-agent/Dockerfile
Normal file
74
letsbe-sysadmin-agent/Dockerfile
Normal file
@@ -0,0 +1,74 @@
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies
|
||||
# - Docker CLI for docker executor
|
||||
# - curl for health checks
|
||||
# - Playwright browser dependencies
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
docker-cli \
|
||||
curl \
|
||||
# Playwright Chromium dependencies
|
||||
libnss3 \
|
||||
libnspr4 \
|
||||
libatk1.0-0 \
|
||||
libatk-bridge2.0-0 \
|
||||
libcups2 \
|
||||
libdrm2 \
|
||||
libdbus-1-3 \
|
||||
libxkbcommon0 \
|
||||
libatspi2.0-0 \
|
||||
libxcomposite1 \
|
||||
libxdamage1 \
|
||||
libxfixes3 \
|
||||
libxrandr2 \
|
||||
libgbm1 \
|
||||
libasound2 \
|
||||
libpango-1.0-0 \
|
||||
libcairo2 \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Install Docker Compose plugin (not in Debian repos, download from Docker)
|
||||
RUN mkdir -p /usr/local/lib/docker/cli-plugins && \
|
||||
curl -SL "https://github.com/docker/compose/releases/download/v2.32.1/docker-compose-linux-x86_64" \
|
||||
-o /usr/local/lib/docker/cli-plugins/docker-compose && \
|
||||
chmod +x /usr/local/lib/docker/cli-plugins/docker-compose
|
||||
|
||||
# Copy requirements first for layer caching
|
||||
COPY requirements.txt .
|
||||
|
||||
# Install Python dependencies
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Install Playwright browsers (Chromium only for smaller image)
|
||||
# Skip install-deps as we manually install required libs above
|
||||
# and the automatic deps installer uses outdated Ubuntu package names
|
||||
RUN playwright install chromium
|
||||
|
||||
# Copy application code
|
||||
COPY app/ ./app/
|
||||
|
||||
# Create non-root user for security
|
||||
RUN useradd -m -s /bin/bash agent && \
|
||||
mkdir -p /home/agent/.letsbe-agent && \
|
||||
mkdir -p /opt/letsbe/playwright-artifacts && \
|
||||
chown -R agent:agent /home/agent/.letsbe-agent && \
|
||||
chown -R agent:agent /opt/letsbe/playwright-artifacts
|
||||
|
||||
# Environment
|
||||
ENV PYTHONUNBUFFERED=1
|
||||
ENV PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
# Default to non-root user
|
||||
# Note: May need root for Docker socket access; use docker group instead
|
||||
USER agent
|
||||
|
||||
# Entry point
|
||||
CMD ["python", "-m", "app.main"]
|
||||
|
||||
# Health check
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD python -c "import sys; sys.exit(0)"
|
||||
Reference in New Issue
Block a user