yukee1992 commited on
Commit
ea34ec5
·
verified ·
1 Parent(s): a012ae4

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +3 -15
Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM python:3.10-slim as builder
2
 
3
  # System dependencies
4
  RUN apt-get update && apt-get install -y \
@@ -15,16 +15,8 @@ RUN pip install --no-cache-dir torch==2.2.0 --index-url https://download.pytorch
15
  RUN pip install --no-cache-dir \
16
  transformers==4.40.0 \
17
  gradio==4.24.0 \
18
- accelerate==0.29.0
19
-
20
- # Runtime image
21
- FROM python:3.10-slim
22
- WORKDIR /app
23
-
24
- # Copy only necessary files
25
- COPY --from=builder /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
26
- COPY --from=builder /usr/local/bin/git-lfs /usr/local/bin/
27
- COPY --from=builder /app/app.py .
28
 
29
  # Environment variables
30
  ENV PYTHONUNBUFFERED=1 \
@@ -33,9 +25,5 @@ ENV PYTHONUNBUFFERED=1 \
33
  HF_TOKEN="" \
34
  DEVICE="cpu"
35
 
36
- # Health check
37
- HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
38
- CMD curl -f http://localhost:7860 || exit 1
39
-
40
  EXPOSE 7860
41
  CMD ["python", "app.py"]
 
1
+ FROM python:3.10-slim
2
 
3
  # System dependencies
4
  RUN apt-get update && apt-get install -y \
 
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 \
 
25
  HF_TOKEN="" \
26
  DEVICE="cpu"
27
 
 
 
 
 
28
  EXPOSE 7860
29
  CMD ["python", "app.py"]