Mohammed Foud commited on
Commit
ff2059e
·
1 Parent(s): 7578233

Add application file

Browse files
Files changed (2) hide show
  1. Dockerfile +32 -0
  2. d.sh +3 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a smaller base image compatible with Spaces
2
+ FROM python:3.10-slim
3
+
4
+ # Set up environment
5
+ ENV PORT=7860
6
+ ENV SHM_SIZE="1g"
7
+ ENV DEBIAN_FRONTEND=noninteractive
8
+
9
+ # Install required system dependencies
10
+ RUN apt-get update && \
11
+ apt-get install -y --no-install-recommends \
12
+ wget \
13
+ xvfb \
14
+ x11vnc \
15
+ fluxbox \
16
+ && rm -rf /var/lib/apt/lists/*
17
+
18
+ # Create necessary directories
19
+ RUN mkdir -p /app/har_and_cookies /app/generated_media && \
20
+ chown -R 1000:1000 /app/har_and_cookies /app/generated_media
21
+
22
+ # Install Python dependencies
23
+ RUN pip install --no-cache-dir g4f[slim]
24
+
25
+ # Expose the required ports
26
+ EXPOSE 7860
27
+
28
+ # Set up volumes
29
+ VOLUME ["/app/har_and_cookies", "/app/generated_media"]
30
+
31
+ # Command to run the application
32
+ CMD ["sh", "-c", "python -m g4f --debug --port $PORT"]
d.sh ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ git add .
2
+ git commit -m "Add application file"
3
+ git push