Mohammed Foud commited on
Commit ·
55531a5
1
Parent(s): bcaa0a6
Add application file
Browse files- 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 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 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"]
|