Files
2025-05-05 22:57:35 +09:00
..
2025-05-05 22:57:35 +09:00

Run

sudo apt install -y supervisor
supervisord -c supervisord.conf -n

supervisord.conf

[supervisord]
nodaemon=true
logfile=/dev/null
loglevel=critical

[program:process1]
command=sh -c "while true; do echo hello; sleep 2; done"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

[program:process2]
command=sh -c "while true; do echo world; sleep 3; done"
autostart=true
autorestart=true
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0

compose.yml

services:
  chrome:
    image: yauk.tv/python
    build:
      dockerfile_inline: |
        FROM debian

        RUN apt-get update && apt-get install -y chromium supervisor
        RUN pip install mitmproxy

        COPY <<EOF /supervisord.conf
        [supervisord]
        nodaemon=true
        logfile=/dev/null
        loglevel=critical

        [program:process1]
        command=sh -c "while true; do echo hello; sleep 2; done"
        autostart=true
        autorestart=true
        stdout_logfile=/dev/stdout
        stdout_logfile_maxbytes=0
        stderr_logfile=/dev/stderr
        stderr_logfile_maxbytes=0

        [program:process2]
        command=sh -c "while true; do echo world; sleep 3; done"
        autostart=true
        autorestart=true
        stdout_logfile=/dev/stdout
        stdout_logfile_maxbytes=0
        stderr_logfile=/dev/stderr
        stderr_logfile_maxbytes=0
        EOF

        CMD ["/usr/bin/supervisord"]