Dockerfile•871 B
# Use Python 3.13 Alpine image for better security and smaller size
FROM python:3.13-alpine
# Set working directory
WORKDIR /app
# Install system dependencies and uv
RUN apk add --no-cache \
gcc \
musl-dev
# Copy requirements first for better caching
COPY pyproject.toml README.md LICENSE CHANGELOG.md ./
# Copy application code
COPY src/ ./src
# Install Python dependencies using uv
RUN pip install --no-cache-dir -e .
# Create non-root user for security (Alpine compatible)
RUN adduser -D -u 1000 mcpuser && chown -R mcpuser:mcpuser /app
USER mcpuser
# Expose ports for SSE and HTTP transports
EXPOSE 3001
# Backend URL must be provided via env (compose/env_file). No container-local default.
# ENV PERPLEXICA_BACKEND_URL=<set via compose>
# Default command (can be overridden)
CMD ["python", "src/perplexica_mcp/server.py", "http", "0.0.0.0", "3001"]