Techbitforge commited on
Commit
9ed359f
·
verified ·
1 Parent(s): 7f8b6ae

Upload 3 files

Browse files
Files changed (3) hide show
  1. Dockerfile +25 -0
  2. app.py +5 -0
  3. requirements.txt +4 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM python:3.12-slim
2
+
3
+ # Install system dependencies
4
+ RUN apt-get update && apt-get install -y \
5
+ wget \
6
+ build-essential \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # Create and chmod /data so your code can write there
10
+ RUN mkdir /data && chmod 777 /data
11
+
12
+ WORKDIR /app
13
+
14
+ # Copy and install Python packages
15
+ COPY requirements.txt ./
16
+ RUN pip install --no-cache-dir -r requirements.txt
17
+
18
+ # Download your server.py as app.py
19
+ RUN wget https://huggingface.co/datasets/Techbitforge/0/resolve/main/server.py \
20
+ -O app.py
21
+
22
+ EXPOSE 7860
23
+
24
+ # Run via Gunicorn, binding to 0.0.0.0:7860
25
+ CMD ["gunicorn", "app:app", "--bind", "0.0.0.0:7860", "--workers", "1"]
app.py ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ from server import app
2
+
3
+
4
+ if __name__ == "__main__":
5
+ app.run(host="0.0.0.0", port=7860)
requirements.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ flask
2
+ requests
3
+ flask_cors
4
+ gunicorn