I try to install supervisor on my local docker container where I run php8.1 and laravel 9.
But I have following error:
'PermissionError: [Errno 13] Permission denied: '/var/log/supervisor/supervisord.log'
This is my config:
supervisor.conf
[program:laravel-worker]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/artisan queue:work
autostart=true
autorestart=true
stopasgroup=true
killasgroup=true
numprocs=1
redirect_stderr=true
stdout_logfile=/var/www/html/storage/logs/worker.log
stopwaitsecs=3600
stdout_logfile_maxbytes=5MB
php dockerfile:
FROM php:8.1.13-fpm
RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libpng-dev
nano
libxslt1.1
libxslt1-dev
unzip
git
gnupg
libpq-dev
libzip-dev
iputils-ping
supervisor
&& docker-php-ext-install zip
gd
mysqli pdo pdo_mysql
&& docker-php-ext-enable pdo_mysql
&& docker-php-ext-configure gd --with-freetype --with-jpeg
&& docker-php-ext-configure intl
RUN echo "memory_limit='512M'" >> /usr/local/etc/php/conf.d/php-extra.ini;
ENV PHP_IDE_CONFIG "serverName=new_app"
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/bin --filename=composer --version=2.3.8 && chmod +x /usr/bin/composer
# Set timezone
RUN rm /etc/localtime
&& ln -s /usr/share/zoneinfo/Europe/Warsaw /etc/localtime
&& "date"
&& printf '[PHP]ndate.timezone = "Europe/Warsaw"n' > /usr/local/etc/php/conf.d/tzone.ini
RUN usermod -aG docker $USER
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
WORKDIR /var/www/html
How can I fix it?
Regards.