yukee1992 commited on
Commit
3e8f82f
·
verified ·
1 Parent(s): 576d861

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -22
Dockerfile CHANGED
@@ -1,31 +1,12 @@
1
  FROM python:3.10-slim
2
 
3
- # System dependencies
4
- RUN apt-get update && apt-get install -y \
5
- git \
6
- git-lfs \
7
- && rm -rf /var/lib/apt/lists/* \
8
- && git lfs install
9
-
10
  WORKDIR /app
11
  COPY . .
12
 
13
- # Install with separate layers for better caching
14
- RUN pip install --no-cache-dir torch==2.2.0 --index-url https://download.pytorch.org/whl/cpu
15
- RUN pip install --no-cache-dir \
16
- transformers==4.40.0 \
17
- gradio==4.24.0 \
18
- accelerate==0.29.0 \
19
- fastapi
20
 
21
- # Environment variables
22
- ENV PYTHONUNBUFFERED=1 \
23
- GRADIO_SERVER_NAME=0.0.0.0 \
24
- GRADIO_SERVER_PORT=7860 \
25
- HF_TOKEN="" \
26
- DEVICE="cpu"
27
- # Add this to your Dockerfile environment variables
28
- PORT=7860
29
 
30
  EXPOSE 7860
31
  CMD ["python", "app.py"]
 
1
  FROM python:3.10-slim
2
 
 
 
 
 
 
 
 
3
  WORKDIR /app
4
  COPY . .
5
 
6
+ RUN pip install --no-cache-dir -r requirements.txt
 
 
 
 
 
 
7
 
8
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
9
+ CMD curl -f http://localhost:7860/ || exit 1
 
 
 
 
 
 
10
 
11
  EXPOSE 7860
12
  CMD ["python", "app.py"]