azils3 commited on
Commit
087d192
·
verified ·
1 Parent(s): 5ea5763

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +6 -8
Dockerfile CHANGED
@@ -23,16 +23,14 @@ COPY --chown=professor:professor . .
23
 
24
  # Set environment variables
25
  ENV LOG_PATH=/app/BotLog.txt
26
- ENV FLASK_APP=app.py
27
- ENV FLASK_DEBUG=0
28
- ENV FLASK_RUN_HOST=0.0.0.0
29
- ENV FLASK_RUN_PORT=7860
30
 
31
  # Ensure the log file is writable
32
  RUN touch $LOG_PATH && chmod 666 $LOG_PATH
33
 
34
- # Expose port
35
- EXPOSE 7860
36
 
37
- # Start Pyrogram bot and Flask app separately
38
- CMD ["sh", "-c", "python bot.py & flask run"]
 
23
 
24
  # Set environment variables
25
  ENV LOG_PATH=/app/BotLog.txt
26
+ ENV UVICORN_HOST=0.0.0.0
27
+ ENV UVICORN_PORT=8000
 
 
28
 
29
  # Ensure the log file is writable
30
  RUN touch $LOG_PATH && chmod 666 $LOG_PATH
31
 
32
+ # Expose port for FastAPI
33
+ EXPOSE 8000
34
 
35
+ # Start the FastAPI app
36
+ CMD ["uvicorn", "fastapi_app:app", "--host", "$UVICORN_HOST", "--port", "$UVICORN_PORT", "--log-level", "info"]