- ./erp24:/www
- ./docker/php/conf/php-fpm.conf:/usr/local/etc/php-fpm.conf
- ./docker/php/conf/php.ini:/usr/local/etc/php/php.ini
+ queue-yii_erp24:
+ build:
+ context: ./docker/supervisor
+ dockerfile: Dockerfile
+ restart: always
+ depends_on:
+ - rabbitmq-yii_erp24
+ env_file:
+ - docker/php/dev.php.env
+ - docker/db/dev.db-pgsql.env
+ environment:
+ MODE: 'dev'
+ volumes:
+ - ./erp24:/www
+ - ./docker/supervisor/conf/supervisord.conf:/etc/supervisor/supervisord.conf
+ - ./docker/supervisor/conf/queue-worker.conf:/etc/supervisor/conf.d/queue-worker.conf
db-yii_erp24:
build: ./docker/db
restart: always
RUN docker-php-ext-install bcmath sockets
RUN docker-php-ext-enable bcmath sockets
-
#add composer
RUN wget https://getcomposer.org/installer \
&& php installer \
&& docker-php-ext-enable xdebug \
&& apk del .build-deps
-# Установка Supervisor
-#RUN apk add --no-cache supervisor
-
-# Создаем каталог для логов Supervisor
-#RUN mkdir -p /var/log/supervisor
-
-# Копирование скрипта ожидания RabbitMQ
-#COPY /conf/wait-for-rabbitmq.sh /usr/local/bin/wait-for-rabbitmq
-#RUN chmod +x /usr/local/bin/wait-for-rabbitmq
-
-# Копирование конфигурации Supervisor
-#COPY /conf/supervisord.conf /etc/supervisor/supervisord.conf
-#COPY /conf/supervisor-conf.d/ /etc/supervisor/conf.d/
-
-
# Set working directory
WORKDIR /www
-# Установка CMD для запуска Supervisor через скрипт ожидания
-#CMD ["/usr/local/bin/wait-for-rabbitmq", "supervisord", "-c", "/etc/supervisor/supervisord.conf"]
-#CMD ["/usr/local/bin/wait-for-rabbitmq", "php", "/www/yii", "queue/listen"]
\ No newline at end of file
+++ /dev/null
-[program:yii-queue]
-command=php /www/yii queue/listen
-directory=/www
-autostart=true
-autorestart=true
-stderr_logfile=/var/log/supervisor/yii-queue.err.log
-stdout_logfile=/var/log/supervisor/yii-queue.out.log
-numprocs=1
-user=www-data
-stopasgroup=true
-killasgroup=true
\ No newline at end of file
+++ /dev/null
-[supervisord]
-nodaemon=true
-logfile=/var/log/supervisor/supervisord.log
-logfile_maxbytes=50MB
-logfile_backups=10
-loglevel=info
-pidfile=/var/run/supervisord.pid
-childlogdir=/var/log/supervisor
-
-[include]
-files = /etc/supervisor/conf.d/*.conf
\ No newline at end of file
+++ /dev/null
-#!/bin/bash
-echo "Waiting for RabbitMQ to start..."
-until nc -z rabbitmq-yii_erp24 5672; do
- echo "RabbitMQ is unavailable - sleeping"
- sleep 2
-done
-
-echo "RabbitMQ is up - executing command"
-exec "$@"
\ No newline at end of file
--- /dev/null
+FROM php:8.1-cli-alpine
+
+# Установка Supervisor
+RUN apk add --no-cache supervisor bash
+RUN mkdir -p /var/log/supervisor
+# Копирование конфигурации
+COPY ./conf/supervisord.conf /etc/supervisor/supervisord.conf
+COPY ./conf/queue-worker.conf /etc/supervisor/conf.d/queue-worker.conf
+
+# Установка рабочей директории
+WORKDIR /www
+
+CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf"]
\ No newline at end of file
--- /dev/null
+[program:yii-queue]
+command=/usr/local/bin/php /www/yii queue/listen --verbose
+autostart=true
+autorestart=true
+stderr_logfile=/var/log/supervisor/yii-queue.err.log
+stdout_logfile=/var/log/supervisor/yii-queue.out.log
\ No newline at end of file
--- /dev/null
+[supervisord]
+nodaemon=true
+logfile=/var/log/supervisor/supervisord.log
+pidfile=/var/run/supervisord.pid
+
+[include]
+files = /etc/supervisor/conf.d/*.conf
\ No newline at end of file