hfacemko commited on
Commit
db9da1a
·
verified ·
1 Parent(s): 7a2d3b3

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +24 -8
Dockerfile CHANGED
@@ -1,20 +1,36 @@
1
- FROM python:3.13.5-slim
2
 
 
3
  WORKDIR /app
4
 
 
5
  RUN apt-get update && apt-get install -y \
6
- build-essential \
7
  curl \
8
  git \
9
  && rm -rf /var/lib/apt/lists/*
10
 
11
- COPY requirements.txt ./
12
- COPY src/ ./src/
13
 
14
- RUN pip3 install -r requirements.txt
 
15
 
16
- EXPOSE 8501
 
 
17
 
18
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health
 
19
 
20
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.11-slim
2
 
3
+ # Set working directory
4
  WORKDIR /app
5
 
6
+ # Install system dependencies
7
  RUN apt-get update && apt-get install -y \
8
+ gcc \
9
  curl \
10
  git \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Clone
14
+ RUN git clone https://github.com/gzzhongqi/geminicli2api.git /app
15
 
16
+ # Install Python dependencies
17
+ RUN pip install --no-cache-dir -r requirements.txt
18
 
19
+ # Create non-root user for security
20
+ RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
21
+ USER appuser
22
 
23
+ # Expose ports (8888 for compatibility, 7860 for Hugging Face)
24
+ EXPOSE 8888 7860
25
 
26
+ # Set environment variables
27
+ ENV PYTHONPATH=/app
28
+ ENV HOST=0.0.0.0
29
+ ENV PORT=7860
30
+
31
+ # Health check (use PORT environment variable)
32
+ HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
33
+ CMD curl -f http://localhost:${PORT}/health || exit 1
34
+
35
+ # Run the application using app.py (Hugging Face compatible entry point)
36
+ CMD ["python", "app.py"]