dragxd commited on
Commit
f2d1bff
·
1 Parent(s): eb0c315

Fix: Update port to 7860 for Hugging Face Spaces and improve offline mode logging

Browse files
Files changed (2) hide show
  1. Dockerfile +3 -3
  2. main.py +3 -1
Dockerfile CHANGED
@@ -11,8 +11,8 @@ RUN pip install --no-cache-dir -r requirements.txt
11
  # Copy the application code to the working directory
12
  COPY . .
13
 
14
- # Expose the port on which the application will run
15
- EXPOSE 8080
16
 
17
  # Run the FastAPI application using uvicorn server
18
- CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
 
11
  # Copy the application code to the working directory
12
  COPY . .
13
 
14
+ # Expose the port on which the application will run (Hugging Face Spaces uses 7860)
15
+ EXPOSE 7860
16
 
17
  # Run the FastAPI application using uvicorn server
18
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]
main.py CHANGED
@@ -29,9 +29,11 @@ async def lifespan(app: FastAPI):
29
 
30
  # If clients failed to initialize, initialize DRIVE_DATA in offline mode
31
  if not clients_initialized:
 
32
  from utils.directoryHandler import initDriveDataWithoutClients
33
  await initDriveDataWithoutClients()
34
- logger.warning("Website is running in OFFLINE MODE - Telegram features are disabled")
 
35
 
36
  # Start the website auto ping task
37
  asyncio.create_task(auto_ping_website())
 
29
 
30
  # If clients failed to initialize, initialize DRIVE_DATA in offline mode
31
  if not clients_initialized:
32
+ logger.warning("No Telegram clients available - Initializing in OFFLINE MODE")
33
  from utils.directoryHandler import initDriveDataWithoutClients
34
  await initDriveDataWithoutClients()
35
+ logger.warning("Website is running in OFFLINE MODE - Telegram features are disabled")
36
+ logger.info("✅ Website UI is available - File operations requiring Telegram will show errors")
37
 
38
  # Start the website auto ping task
39
  asyncio.create_task(auto_ping_website())