chemistrymath commited on
Commit
3fa8c63
·
verified ·
1 Parent(s): f31b39a

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -17
Dockerfile CHANGED
@@ -1,17 +1,24 @@
1
- # Use an official Python image
2
- FROM python:3.9
3
-
4
- # Set the working directory inside the container
5
- WORKDIR /app
6
-
7
- # Copy all files to the container
8
- COPY . /app/
9
-
10
- # Install dependencies
11
- RUN pip install --no-cache-dir -r requirements.txt
12
-
13
- # Expose port 7860 (Hugging Face default)
14
- EXPOSE 7860
15
-
16
- # Run FastAPI using Uvicorn
17
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
 
 
 
 
 
 
1
+ # Use an official Python image
2
+ FROM python:3.9
3
+
4
+ # Set the working directory inside the container
5
+ WORKDIR /app
6
+
7
+ # Copy all files to the container
8
+ COPY . /app/
9
+
10
+ # Install dependencies
11
+ RUN pip install --no-cache-dir -r requirements.txt
12
+
13
+ # Set environment variables to fix Matplotlib and Fontconfig issues
14
+ ENV MPLCONFIGDIR=/tmp/matplotlib
15
+ ENV XDG_CACHE_HOME=/tmp
16
+
17
+ # Create the directories to ensure they exist
18
+ RUN mkdir -p /tmp/matplotlib /tmp/numba_cache
19
+
20
+ # Expose port 7860 (Hugging Face default)
21
+ EXPOSE 7860
22
+
23
+ # Run FastAPI using Uvicorn
24
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]