mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
Add a complete example demonstrating dirty workers with sentence-transformers for text embeddings via FastAPI: - EmbeddingApp DirtyApp that loads and manages the ML model - FastAPI endpoints for /embed and /health - Docker and docker-compose configuration - Integration tests with numpy similarity checks - GitHub Actions CI workflow
22 lines
423 B
Docker
22 lines
423 B
Docker
FROM python:3.12-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
RUN pip install --no-cache-dir \
|
|
sentence-transformers \
|
|
fastapi \
|
|
pydantic
|
|
|
|
# Copy gunicorn source
|
|
COPY . /app/gunicorn-src
|
|
RUN pip install /app/gunicorn-src
|
|
|
|
# Copy app
|
|
COPY examples/embedding_service /app/embedding_service
|
|
|
|
ENV PYTHONPATH=/app
|
|
|
|
EXPOSE 8000
|
|
CMD ["gunicorn", "embedding_service.main:app", "-c", "embedding_service/gunicorn_conf.py"]
|