From d54100cbc457f145179e14d616fa237b6bfc5109 Mon Sep 17 00:00:00 2001 From: Kamil Date: Mon, 9 Dec 2024 10:20:04 +0000 Subject: [PATCH] add supervisor support to Dockerfile and create supervisord configuration --- Dockerfile | 5 +++-- supervisord.conf | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 supervisord.conf diff --git a/Dockerfile b/Dockerfile index fa5c96c..f1c4ac5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -8,7 +8,7 @@ WORKDIR /jellyplist COPY requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt RUN apt update -RUN apt install ffmpeg netcat-openbsd -y +RUN apt install ffmpeg netcat-openbsd supervisor -y # Copy the application code COPY . . COPY entrypoint.sh /entrypoint.sh @@ -16,6 +16,7 @@ RUN chmod +x /entrypoint.sh # Expose the port the app runs on EXPOSE 5055 +COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf # Set the entrypoint @@ -23,4 +24,4 @@ ENTRYPOINT ["/entrypoint.sh"] # Run the application -CMD ["python", "run.py"] \ No newline at end of file +CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] \ No newline at end of file diff --git a/supervisord.conf b/supervisord.conf new file mode 100644 index 0000000..7ddc2f4 --- /dev/null +++ b/supervisord.conf @@ -0,0 +1,23 @@ +[supervisord] +nodaemon=true + +[program:jellyplist] +command=python run.py +autostart=true +autorestart=true +stderr_logfile=/var/log/jellyplist.supervisord.err.log +stdout_logfile=/var/log/jellyplist.supervisord.out.log + +[program:celery_worker] +command=celery -A app.celery worker +autostart=true +autorestart=true +stderr_logfile=/var/log/jellyplist.celery_worker.supervisord.err.log +stdout_logfile=/var/log/jellyplist.celery_worker.supervisord.out.log + +[program:celery_beat] +command=celery -A app.celery beat +autostart=true +autorestart=true +stderr_logfile=/var/log/jellyplist.celery_beat.supervisord.err.log +stdout_logfile=/var/log/jellyplist.celery_beat.supervisord.out.log \ No newline at end of file