mic3333 commited on
Commit
72db3f9
·
verified ·
1 Parent(s): a3bc8b1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -3
Dockerfile CHANGED
@@ -1,11 +1,26 @@
1
- FROM python:3.9
2
 
3
  WORKDIR /code
4
 
5
- COPY ./requirements.txt /code/requirements.txt
 
 
 
 
6
 
 
 
 
 
 
 
7
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
8
 
 
9
  COPY . /code
10
 
11
- CMD ["gunicorn", "--bind", "0.0.0.0:7860", "app:server"]
 
 
 
 
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /code
4
 
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ gcc \
8
+ g++ \
9
+ && rm -rf /var/lib/apt/lists/*
10
 
11
+ # Copy requirements first for better caching
12
+ COPY requirements.txt /code/requirements.txt
13
+
14
+ # Install Python dependencies with specific order
15
+ RUN pip install --no-cache-dir --upgrade pip
16
+ RUN pip install --no-cache-dir numpy==1.24.3
17
  RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
18
 
19
+ # Copy the rest of the code
20
  COPY . /code
21
 
22
+ # Expose port 7860 for Hugging Face Spaces
23
+ EXPOSE 7860
24
+
25
+ # Run the application
26
+ CMD ["python", "app.py"]