yukee1992 commited on
Commit
9f102f4
·
verified ·
1 Parent(s): a434ebb

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +17 -12
Dockerfile CHANGED
@@ -1,26 +1,31 @@
1
- FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- curl \
8
- gcc \
9
- g++ \
10
- && rm -rf /var/lib/apt/lists/*
11
 
12
  # Copy requirements first
13
  COPY requirements.txt .
14
  RUN pip install --no-cache-dir -r requirements.txt
15
 
16
- # Copy app code
17
- COPY app.py .
18
 
19
- EXPOSE 7860
 
 
 
 
 
 
20
 
21
  # Health check
22
- HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
23
  CMD curl -f http://localhost:7860/health || exit 1
24
 
25
- # Run with uvicorn
26
- CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
+ FROM python:3.10-slim
2
 
3
  WORKDIR /app
4
 
5
  # Install system dependencies
6
+ RUN apt-get update && \
7
+ apt-get install -y --no-install-recommends gcc python3-dev curl && \
8
+ rm -rf /var/lib/apt/lists/*
 
 
9
 
10
  # Copy requirements first
11
  COPY requirements.txt .
12
  RUN pip install --no-cache-dir -r requirements.txt
13
 
14
+ # Copy application
15
+ COPY . .
16
 
17
+ # Environment variables
18
+ ENV PORT=7860
19
+ ENV HF_TOKEN=""
20
+ ENV API_KEY="default-key-123"
21
+ ENV DEVICE="cpu"
22
+ ENV MAX_TOKENS=450
23
+ ENV MODEL_ID="google/gemma-1.1-2b-it"
24
 
25
  # Health check
26
+ HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \
27
  CMD curl -f http://localhost:7860/health || exit 1
28
 
29
+ EXPOSE 7860
30
+
31
+ CMD ["python", "app.py"]