Spaces:
Running
Running
debug: run as root and add startup logs
Browse files- Dockerfile +10 -11
- main.py +5 -0
Dockerfile
CHANGED
|
@@ -21,17 +21,16 @@ RUN playwright install chromium
|
|
| 21 |
# Copy application code
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
-
#
|
| 25 |
-
#
|
| 26 |
-
RUN
|
| 27 |
-
|
| 28 |
-
#
|
| 29 |
-
#
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
ENV
|
| 34 |
-
ENV PATH=$HOME/.local/bin:$PATH
|
| 35 |
|
| 36 |
# Expose the port (Hugging Face uses 7860 by default)
|
| 37 |
EXPOSE 7860
|
|
|
|
| 21 |
# Copy application code
|
| 22 |
COPY . .
|
| 23 |
|
| 24 |
+
# Remove user creation for debugging permissions
|
| 25 |
+
# RUN useradd -m -u 1001 user
|
| 26 |
+
# RUN chown -R user:user /app
|
| 27 |
+
# USER user
|
| 28 |
+
# ENV HOME=/home/user
|
| 29 |
+
# ENV PATH=$HOME/.local/bin:$PATH
|
| 30 |
+
|
| 31 |
+
# Run as root for now to fix 404 crash
|
| 32 |
+
ENV HOME=/root
|
| 33 |
+
ENV PATH=/root/.local/bin:$PATH
|
|
|
|
| 34 |
|
| 35 |
# Expose the port (Hugging Face uses 7860 by default)
|
| 36 |
EXPOSE 7860
|
main.py
CHANGED
|
@@ -8,6 +8,11 @@ Run with: uvicorn main:app --host 0.0.0.0 --port 8000
|
|
| 8 |
"""
|
| 9 |
|
| 10 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 11 |
|
| 12 |
# Fix for Vercel Read-Only File System
|
| 13 |
# Must be set BEFORE importing g4f or engine
|
|
|
|
| 8 |
"""
|
| 9 |
|
| 10 |
import os
|
| 11 |
+
import sys
|
| 12 |
+
|
| 13 |
+
print("🔥 STARTING K-AI API... 🔥", file=sys.stderr)
|
| 14 |
+
print(f"Current Working Directory: {os.getcwd()}", file=sys.stderr)
|
| 15 |
+
print(f"Directory Contents: {os.listdir('.')}", file=sys.stderr)
|
| 16 |
|
| 17 |
# Fix for Vercel Read-Only File System
|
| 18 |
# Must be set BEFORE importing g4f or engine
|