gcloud-lab/apps/base/customer1/embedding-service/Dockerfile.embedding

19 lines
482 B
Text
Raw Normal View History

FROM python:3.12-slim
WORKDIR /app
# Install sentence-transformers and deps
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application
COPY app.py .
# Health check
HEALTHCHECK --interval=30s --timeout=5s --start-period=60s --retries=3 \
CMD python -c "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')" || exit 1
EXPOSE 8000
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "1"]