flokabukie's picture
Update Dockerfile
52229d0
raw
history blame contribute delete
696 Bytes
# Base image
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
# Set working directory
WORKDIR /app
# Create a writable directory for the cache
RUN mkdir -p /.cache/huggingface/hub && chmod -R 777 /.cache
# Set the TRANSFORMERS_CACHE environment variable
ENV TRANSFORMERS_CACHE /.cache/huggingface/hub
# Copy the API files to the container
COPY main.py .
COPY model.pkl .
COPY scaler.pkl .
# Upgrade pip
RUN /usr/local/bin/python -m pip install --upgrade pip
# Install dependencies
RUN pip install --no-cache-dir fastapi pydantic uvicorn scikit-learn joblib pandas numpy
# Expose the API port
EXPOSE 7860
# Start the API
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]