You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
Docker
40 lines
1.1 KiB
Docker
# Python Embedding Service Dockerfile
|
|
# Author: Martin.Schweitzer@procon.co.at and claude.ai
|
|
#
|
|
# Provides HTTP API for generating text embeddings using sentence-transformers
|
|
# Model: intfloat/multilingual-e5-large (1024 dimensions)
|
|
|
|
FROM python:3.11-slim
|
|
|
|
WORKDIR /app
|
|
|
|
# Install system dependencies
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
curl \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
# Install Python dependencies
|
|
COPY requirements-embedding.txt .
|
|
RUN pip install --no-cache-dir -r requirements-embedding.txt
|
|
|
|
# Copy application code
|
|
COPY embedding_service.py .
|
|
|
|
# Pre-download model (optional - reduces startup time)
|
|
# RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('intfloat/multilingual-e5-large')"
|
|
|
|
# Environment variables
|
|
ENV MODEL_NAME=intfloat/multilingual-e5-large
|
|
ENV MAX_LENGTH=512
|
|
ENV HOST=0.0.0.0
|
|
ENV PORT=8001
|
|
|
|
EXPOSE 8001
|
|
|
|
# Health check
|
|
HEALTHCHECK --interval=30s --timeout=10s --start-period=60s --retries=3 \
|
|
CMD curl -f http://localhost:8001/health || exit 1
|
|
|
|
# Run the service
|
|
CMD ["python", "embedding_service.py"]
|