use supervisor

This commit is contained in:
BennyThink 2021-08-21 16:05:47 +08:00
parent f2aabf6a1d
commit e5ad85e6ff
No known key found for this signature in database
GPG Key ID: 6CD0DBDA5235D481
3 changed files with 21 additions and 3 deletions

View File

@ -14,6 +14,5 @@ COPY --from=builder /root/.local /usr/local
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY . /ytdlbot
RUN echo "/usr/sbin/vnstatd -d;/usr/local/bin/python ytdl.py"> /ytdlbot/start.sh
CMD ["sh", "start.sh"]
CMD ["/usr/local/bin/supervisord", "-c" ,"/ytdlbot/supervisor.conf"]

View File

@ -7,4 +7,5 @@ filetype
redis
requests
APScheduler==3.7.0
beautifultable==1.0.1
beautifultable==1.0.1
supervisor

18
supervisor.conf Normal file
View File

@ -0,0 +1,18 @@
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0
user=root
[program:vnstat]
command=vnstatd -n
autorestart=true
[program:ytdl]
directory=/ytdlbot
command=python ytdl.py
autorestart=true
stdout_logfile=/dev/fd/1
stdout_logfile_maxbytes=0
redirect_stderr=true