Mohammed Foud commited on
Commit
55531a5
·
1 Parent(s): bcaa0a6

Add application file

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -3
Dockerfile CHANGED
@@ -21,8 +21,13 @@ RUN apt-get update && \
21
  # Switch to the non-root user
22
  USER user
23
 
24
- # Install Python dependencies
25
- RUN pip install --no-cache-dir --user g4f
 
 
 
 
 
26
 
27
  # Ensure the media directories exist with proper permissions
28
  RUN mkdir -p /app/har_and_cookies /app/generated_media && \
@@ -32,4 +37,4 @@ RUN mkdir -p /app/har_and_cookies /app/generated_media && \
32
  EXPOSE 7860
33
 
34
  # Command to run the application
35
- CMD ["sh", "-c", "python -m g4f --debug --port $PORT"]
 
21
  # Switch to the non-root user
22
  USER user
23
 
24
+ # Install Python dependencies with --user flag
25
+ ENV PATH="/home/user/.local/bin:${PATH}"
26
+ RUN pip install --no-cache-dir --user \
27
+ g4f \
28
+ uvicorn \
29
+ fastapi \
30
+ hypercorn
31
 
32
  # Ensure the media directories exist with proper permissions
33
  RUN mkdir -p /app/har_and_cookies /app/generated_media && \
 
37
  EXPOSE 7860
38
 
39
  # Command to run the application
40
+ CMD ["sh", "-c", "python -m g4f.api --debug --port $PORT"]