Answer the question
In order to leave comments, you need to log in
Why does php-fpm container crash when supervisor starts?
There is such file docker-compose.yml
version: "2"
services:
nginx:
image: nginx:latest
container_name: dev-chellange-nginx
ports:
- 7000:80
volumes:
- ./docker/nginx:/etc/nginx/conf.d
- ./src:/usr/share/nginx/html
links:
- php
php:
build: ./docker/php
container_name: dev-chellange-php
volumes:
- ./src:/var/www/html
- ./docker/php/supervisor:/etc/supervisor/conf.d
links:
- mysql
- redis
mysql:
image: mysql
container_name: dev-chellange-mysql
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: password
MYSQL_DATABASE: dev_chellange
redis:
image: redis
container_name: dev-chellange-redis
FROM php:7.4-fpm
# Install dependencies
RUN apt-get update && apt-get install -y \
build-essential \
supervisor \
libpng-dev \
libjpeg62-turbo-dev \
libfreetype6-dev \
locales \
zip \
jpegoptim optipng pngquant gifsicle \
vim \
unzip \
git \
curl
# Install extensions
RUN docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo_mysql
RUN pecl install redis && docker-php-ext-enable redis
CMD ["/usr/bin/supervisord"]
[program:queue-workers]
process_name=%(program_name)s_%(process_num)02d
command=php /var/www/html/application/artisan queue:work --sleep=3 --tries=3 --max-time=3600
autostart=true
autorestart=true
user=root
numprocs=5
redirect_stderr=true
stdout_logfile=/etc/supervisor/conf.d/queue-workers.log
stopwaitsecs=3600
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question