fix: wait for processes in Docker compose mode

This commit is contained in:
Abhishek Kumar 2026-02-04 23:05:22 +05:30
parent b5cb044f8c
commit 5994a33c55
2 changed files with 9 additions and 1 deletions

View file

@ -60,6 +60,8 @@ ENV PYTHONPATH=/app
# Disable file logging in Docker - logs go to stdout for docker logs
ENV LOG_TO_FILE=false
# Keep container alive by waiting for background processes
ENV WAIT_FOR_PROCESSES=true
# Expose the port FastAPI will run on
EXPOSE 8000

View file

@ -54,7 +54,8 @@ LATEST_LINK="$BASE_LOG_DIR/latest" # Symlink to latest logs
VENV_PATH="$BASE_DIR/venv"
ARQ_WORKERS=${ARQ_WORKERS:-1}
LOG_TO_FILE=${LOG_TO_FILE:-true} # Set to false in Docker to use stdout
LOG_TO_FILE=${LOG_TO_FILE:-true} # Set to false in Docker to use stdout
WAIT_FOR_PROCESSES=${WAIT_FOR_PROCESSES:-false} # Set to true in Docker to keep container alive
# Log startup
cd "$BASE_DIR"
@ -282,3 +283,8 @@ echo "Logs: tail -f $LOG_DIR/*.log"
echo "Rotated logs: ls $LOG_DIR/*.log.*"
echo "To stop: ./scripts/stop_services.sh"
echo "──────────────────────────────────────────────────"
# In Docker mode, wait for all background processes to keep container alive
if [[ "$WAIT_FOR_PROCESSES" == "true" ]]; then
wait
fi