Mohammed Foud commited on
Commit
0a1a565
·
1 Parent(s): 39fea65

Add application file

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -2
Dockerfile CHANGED
@@ -29,6 +29,9 @@ RUN pip install --no-cache-dir --user \
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 && \
34
  chmod 755 /app/har_and_cookies /app/generated_media
@@ -36,5 +39,5 @@ RUN mkdir -p /app/har_and_cookies /app/generated_media && \
36
  # Expose the required port
37
  EXPOSE 7860
38
 
39
- # Correct command to run the application using Hypercorn
40
- CMD ["sh", "-c", "hypercorn g4f.api:app --bind 0.0.0.0:${PORT}"]
 
29
  fastapi \
30
  hypercorn
31
 
32
+ # Ensure proper Python path configuration
33
+ ENV PYTHONPATH="${PYTHONPATH}:/home/user/.local/lib/python3.10/site-packages"
34
+
35
  # Ensure the media directories exist with proper permissions
36
  RUN mkdir -p /app/har_and_cookies /app/generated_media && \
37
  chmod 755 /app/har_and_cookies /app/generated_media
 
39
  # Expose the required port
40
  EXPOSE 7860
41
 
42
+ # Correct command to run the application using the g4f CLI
43
+ CMD ["sh", "-c", "python -m g4f api run -p $PORT"]