Spaces:
Runtime error
Runtime error
File size: 710 Bytes
e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 60956da e949425 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# Use Python base image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Create working directory
WORKDIR /app
# Install system dependencies
RUN apt-get update && apt-get install -y \
build-essential \
git \
&& rm -rf /var/lib/apt/lists/*
# Copy requirements and install them
COPY requirements.txt .
RUN pip install --upgrade pip && pip install -r requirements.txt
# Copy app code
COPY . .
# Download model at build time
RUN python -c "from sentence_transformers import SentenceTransformer; SentenceTransformer('all-MiniLM-L6-v2')"
# Expose port
EXPOSE 8080
# Run app
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8080"]
|