File size: 709 Bytes
446f3d2 f2ac04d b0c4302 f5f3b89 a042ddf c4342c3 b0c4302 446f3d2 e935948 446f3d2 a2b53af e935948 |
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 an official Python runtime
FROM python:3.9-slim
# Set the working directory
WORKDIR /app
# Copy the requirements file
COPY requirements.txt .
# Change permission /cache/huggingface
RUN mkdir -p /cache/matplotlib \
&& chmod -R 777 /cache/matplotlib
# Set environment variables for Hugging Face and Matplotlib
ENV HF_HOME=/data/.huggingface
ENV MPLCONFIGDIR=/tmp/cache/matplotlib
ENV HF_TOKEN=ZGV0ZWNULWVkM!XRzLWluLUAxLWdlbmVyQHRlZC10RXh0@
# Flask
ENV FLASK_APP=app.py
# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the app
COPY . .
# Expose the Flask port
EXPOSE 7860
# Run the application
CMD ["flask", "run", "--host=0.0.0.0", "--port=7860"] |