opusdev/vector-similarity-api
1
1# FROM python:3.11-slim2 3# WORKDIR /app4 5# # Install dependencies6# COPY requirements.txt .7# RUN pip install --no-cache-dir -r requirements.txt8 9# # Download model at build time10# RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"11 12# # Copy embedding service13# COPY api/embedding_service.py ./14 15# EXPOSE 800116 17# CMD ["python", "embedding_service.py"]18 19 20 21 22FROM python:3.11-slim23 24WORKDIR /app25 26# Install dependencies27COPY requirements.txt .28RUN pip install --no-cache-dir -r requirements.txt29 30# Download model at build time31RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"32 33# Copy embedding service - CORRECTED34COPY api/embedding_service.py ./embedding_service.py35 36EXPOSE 800137 38# Health check endpoint39HEALTHCHECK --interval=30s --timeout=10s --retries=3 \40 CMD python -c "import requests; requests.get('http://localhost:8001/health', timeout=5).raise_for_status()" || exit 141 42# Run the service43CMD ["python", "embedding_service.py"]