shuba.ivan
shuba.ivan

Reputation: 4061

Docker Alpine Supervisor unix:///run/supervisord.sock no such file

I use docker, docker-compose for images and created image based on alpine 3.10 with my applicaiton and supervisor (by documentation 3.3.5). But after I enterd in container and start supervisorctl I faced with error. Could someone help me how to resolve it ?

volumes from img

volumes:
    - ./php-consume/supervisord.conf:/etc/supervisord/conf.d/supervisord.conf

and my supervisord.conf

[program:messenger-consume]
command=php /var/www/symfony/bin/console messenger:consume success andraction_parse_row_success --limit=100
numprocs=2
autostart=true
autorestart=true
process_name=%(program_name)s_%(process_num)02d

[supervisord]
nodaemon=true

when I entered in container and run supervisorctl

ivan@ivan-laptop:~/hosts/docker-symfony$ docker exec -it bc6df01db4db ash
/var/www/symfony # supervisorctl 
unix:///run/supervisord.sock no such file

Upvotes: 3

Views: 6326

Answers (2)

Daniel Mesa
Daniel Mesa

Reputation: 586

You can use alpine predefined sock as default in your supervisor config:

supervisord.conf

[unix_http_server]
file=/run/supervisord.sock                  ; (the default path in alpine)
chmod=0700

[supervisord]
logfile=/var/log/supervisor/supervisord.log
pidfile=/run/supervisord.pid                ; (supervisord pidfile; in /run)
childlogdir=/var/log/supervisor             ; ('AUTO' child log dir, default $TEMP)

[rpcinterface:supervisor]
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///run/supervisord.sock      ; (the default path in alpine)

Dockerfile

FROM alpine:3.19

RUN apk add --update supervisor

COPY supervisord.conf /etc/supervisor/supervisord.conf

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]

Upvotes: 0

Max Sherbakov
Max Sherbakov

Reputation: 1955

You don't have supervisorctl section. Be sure that you've copied supervisors conf file to /etc/suervisorsd.conf DockerFile

COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
COPY supervisord.conf /etc/supervisord.conf

or started it with param.

DockerFile

CMD ["/usr/bin/supervisord", "-c", "/etc/supervisord.conf"]

Here is my typical configuration of supervisord.conf

[unix_http_server]
file=/dev/shm/supervisor.sock
chmod=0700

[supervisord]
nodaemon=true
logfile=/var/log/supervisor/supervisord.log
childlogdir=/var/log/supervisor

[rpcinterface:supervisor]
supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface

[supervisorctl]
serverurl=unix:///dev/shm/supervisor.sock

Upvotes: 2

Related Questions