hfacemko commited on
Commit
f087a9e
·
verified ·
1 Parent(s): f7429f6

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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"]