Embedding_fastapi / Dockerfile
Ezhil
Added endpoint in main and changes in dockerfile
17c8f2e
raw
history blame
663 Bytes
# Use an official Python base image
FROM python:3.10
# Set the working directory
WORKDIR /app
# Set environment variables for HF cache
ENV HF_HOME="/app/cache"
ENV TRANSFORMERS_CACHE="/app/cache"
ENV SENTENCE_TRANSFORMERS_HOME="/app/cache"
# Create the cache directory with appropriate permissions
RUN mkdir -p /app/cache && chmod -R 777 /app/cache
# Copy the requirements file and install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy the application code
COPY . .
# Expose the FastAPI default port
EXPOSE 8000
# Run FastAPI with Uvicorn
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]