File size: 663 Bytes
5912422
 
 
 
 
 
 
 
 
1935f96
fc6d8ab
 
1935f96
9c479c2
505e748
059717e
 
1640f95
 
 
5912422
 
 
 
 
 
 
 
 
 
1640f95
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
# 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
RUN mkdir -p /cache/huggingface /cache/matplotlib \
    && chmod -R 777 /cache/huggingface /cache/matplotlib

# Set environment variables for HF中国镜像站 and Matplotlib 
ENV HF_HOME=/cache/huggingface
ENV MPLCONFIGDIR=/cache/matplotlib

# 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 5000

# Run the application
CMD ["flask", "run", "--host=0.0.0.0", "--port=5000"]