Agent skill
pyportfolioopt-docker
Generate Dockerfile and requirements.txt for containerizing web applications using PyPortfolioOpt optimization library. Use when containerizing Python apps with PyPortfolioOpt, portfolio optimization, or financial optimization that requires OSQP solver. Handles system-level build dependencies for numerical libraries.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/docker-pyportfolioopt
SKILL.md
PyPortfolioOpt Docker Containerization
Generate production-ready Docker configuration for Python web applications using PyPortfolioOpt.
Requirements.txt
Must contain these packages in this order:
osqp
pyportfolioopt>=1.5.6
Add other project dependencies after these two core packages.
Dockerfile Template
FROM python:3.11-slim
# System dependencies for numerical/optimization libraries
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
pkg-config \
libblas-dev \
liblapack-dev \
gfortran \
libopenblas-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
Key Rules
- System deps before pip: Install all apt packages before
pip install - Clean apt cache: Always end apt stanza with
&& rm -rf /var/lib/apt/lists/* - OSQP first:
osqpmust be in requirements.txt beforepyportfolioopt - Slim base: Use
python:3.X-slimfor smaller image size
Customization
- Adjust
CMDfor your framework (FastAPI/uvicorn shown above) - Add additional Python packages to requirements.txt after the core two
- For Gunicorn:
CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:8000", "main:app"]
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?