Мой конфиг docker-compose.yml:
version: "3"
networks:
mydockernet:
driver: bridge
name: mydockernet
services:
# nginx
nginx-service:
image: nginx:stable-alpine
container_name: nginx-container
ports:
- "8080:80"
volumes:
- ./app:/var/www/project
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php74-service
- mysql8-service
networks:
- mydockernet
# php
php74-service:
build:
context: .
dockerfile: ./php/Dockerfile
container_name: php74-container
restart: always
ports:
- "9000:9000"
volumes:
- ./app:/var/www/project
networks:
- mydockernet
# mysql
mysql8-service:
image: mysql:8
container_name: mysql8-container
ports:
- "4306:3306"
volumes:
- ./mysql:/var/lib/mysql
command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
restart: always # always restart unless stopped manually
environment:
MYSQL_USER: root
MYSQL_ROOT_PASSWORD: secret
MYSQL_PASSWORD: secret
networks:
- mydockernet
rabbitmq-service:
image: 'bitnami/rabbitmq:latest'
container_name: rabbitmq-container
ports:
- "5671:5672"
- "15671:15672"
volumes:
- 'rabbitmq_data:/data'
networks:
- mydockernet
worker-service:
build:
context: .
dockerfile: ./worker/Dockerfile
container_name: worker-container
restart: unless-stopped
depends_on:
- rabbitmq-service
ports:
- "5000:5000"
volumes:
- ./app:/var/www/project
networks:
- mydockernet
volumes:
rabbitmq_data:
Dockerfile для воркера:
FROM php:7.4-fpm
RUN apt-get update && apt-get install -y zlib1g-dev g++ git libicu-dev zip libzip-dev zip \
&& docker-php-ext-install intl opcache pdo pdo_mysql \
&& pecl install apcu \
&& docker-php-ext-enable apcu \
&& docker-php-ext-configure zip \
&& docker-php-ext-install zip
RUN docker-php-ext-install sockets
RUN apt-get install -y librabbitmq-dev \
&& pecl install amqp \
&& docker-php-ext-enable amqp
RUN apt-get install -y inetutils-ping
WORKDIR /var/www/project
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
RUN curl -sS https://get.symfony.com/cli/installer | bash
RUN mv /root/.symfony/bin/symfony /usr/local/bin/symfony
Текущее состояние:
Все контейнеры объединены в одну сеть:
Пинги проходят:
Но тем не менее не могу подключиться:
Продолжение лога:
С этим конфигом:
###> symfony/messenger ###
# Choose one of the transports below
# MESSENGER_TRANSPORT_DSN=doctrine://default
MESSENGER_TRANSPORT_DSN=amqp://user:bitnami@localhost:5671/%2f/messages
# MESSENGER_TRANSPORT_DSN=redis://localhost:6379/messages
###< symfony/messenger ###
При том что через браузер зашел без проблем:
Подскажите пожалуйста, почему не могу подключиться через воркер?