bert-fastapi / Dockerfile
JaySenpai's picture
Update Dockerfile
d2a5d22 verified
raw
history blame contribute delete
550 Bytes
FROM python:3.10-slim
# Set working directory
WORKDIR /code
# Create HF cache directory with write permissions
RUN mkdir -p /code/cache && chmod -R 777 /code/cache
# Set environment variables
ENV TRANSFORMERS_CACHE=/code/cache
# Install dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy app code
COPY app /code/app
# Copy model
COPY ./bert-model /code/./bert-model
# Expose the port used by FastAPI
EXPOSE 7860
# Run the app
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]