matrixcoder commited on
Commit
11c2040
·
verified ·
1 Parent(s): 9a31a49

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +18 -10
Dockerfile CHANGED
@@ -1,17 +1,25 @@
1
- # Use Python base image
2
- FROM python:3.9
3
 
4
- # Set working directory
5
  WORKDIR /app
6
 
7
- # Copy current files into container
8
- COPY . /app
 
9
 
10
- # Install Flask
11
- RUN pip install -r requirements.txt
 
 
 
12
 
13
- # Expose default port
14
  EXPOSE 7860
15
 
16
- # Run with Gunicorn
17
- CMD ["gunicorn", "-w", "4", "-b", "0.0.0.0:7860", "bot_with_api:app"]
 
 
 
 
 
1
+ # Lightweight Python image
2
+ FROM python:3.9-slim
3
 
4
+ # Working directory
5
  WORKDIR /app
6
 
7
+ # Copy dependencies first (better caching)
8
+ COPY requirements.txt .
9
+ RUN pip install --no-cache-dir -r requirements.txt
10
 
11
+ # Copy entire bot code
12
+ COPY bot_with_api.py api.py main.py xC4.py xHeaders.py ./
13
+ COPY Pb2/ ./Pb2/ # Protobuf compiled files
14
+ # Agar protobuf_decoder local folder hai to usse bhi copy karein:
15
+ # COPY protobuf_decoder/ ./protobuf_decoder/
16
 
17
+ # Hugging Face Spaces ka default port (override by environment)
18
  EXPOSE 7860
19
 
20
+ # Flask ko environment PORT variable use karne ke liye
21
+ ENV FLASK_APP=api.py
22
+ ENV FLASK_ENV=production
23
+
24
+ # Start bot + API
25
+ CMD ["python", "bot_with_api.py"]