# Use the official Python image as the base image | |
FROM python:3.10 | |
# Set the working directory in the container | |
WORKDIR /app | |
# Copy the current directory contents into the container at /app | |
COPY . /app | |
# Install any dependencies specified in requirements.txt | |
RUN pip install --no-cache-dir -r requirements.txt | |
ENV HF_HOME /tmp/huggingface | |
# Set the TRANSFORMERS_CACHE environment variable | |
#ENV TRANSFORMERS_CACHE /tmp/transformers_cache | |
# Create a directory for storing files if it doesn't exist | |
RUN mkdir -p riskclassification_finetuned_xlnet_model_ld | |
# Adjust permissions for the directory and its contents | |
RUN chmod -R 777 riskclassification_finetuned_xlnet_model_ld | |
# Expose the port that Flask runs on | |
EXPOSE 5000 | |
# Define the command to run your Flask application | |
CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--workers", "4", "--timeout", "300", "app:app"] | |