-
Notifications
You must be signed in to change notification settings - Fork 658
Problem with Docker #81
Comments
The same issue here, with docker. I have those errors:
Have you handle with it? |
If i remember correctly we started the websocket on --host=0.0.0.0 also exposed the 6001 port in our docker-composer.yml file. |
The same issue here, with docker |
Hi, we handle it. You don't need any additional libraries ect. |
@MWL91
thanks |
Have you port 6001 setup on docker?
… Wiadomość napisana przez edisonchenz ***@***.***> w dniu 14.02.2019, o godz. 01:49:
@MWL91
Hi, thank you
can you share me your docker-compose.yml for websocket
my error same with you
WebSocket connection to 'ws://localhost:6001/app/anyKey?protocol=7&client=js&version=4.3.1&flash=false' failed: Error in connection establishment: net::ERR_SOCKET_NOT_CONNECTED
pusher.min.js:8 WebSocket connection to 'ws://localhost:6001/app/anyKey?protocol=7&client=js&version=4.3.1&flash=false' failed: Connection closed before receiving a handshake response
thanks
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
it would be amazing if this package comes with a docker container out of the box. And is maintained by the owners. Are there any plans for this? @freekmurze @mpociot |
I can share my Dockerfile. FROM php:7.3.3-alpine
RUN apk add --no-cache \
wget \
curl \
git \
shadow \
build-base \
autoconf \
hiredis \
libxml2-dev \
zlib-dev \
libevent \
libevent-dev \
openssl-dev \
gmp-dev \
icu-dev \
&& \
docker-php-ext-install \
pcntl \
mbstring \
pdo \
pdo_mysql \
tokenizer \
xml \
sockets \
gmp \
bcmath \
intl \
&& \
# Libevent
pecl install event && \
# phpiredis
apk add --no-cache --virtual .build-deps \
hiredis-dev \
&& \
git clone https://github.com/francislavoie/phpiredis.git && \
( \
cd phpiredis && \
phpize && ./configure --enable-phpiredis && \
make && make install && \
docker-php-ext-enable phpiredis \
) && \
rm -rf phpiredis && \
# Cleanup
apk del .build-deps && \
rm -rf /var/cache/apk/* && \
mkdir -p /var/www
RUN groupmod -g 1000 www-data && \
usermod -u 1000 www-data
USER www-data
WORKDIR /var/www
EXPOSE 6001
CMD ["php", "artisan", "websockets:serve"] You can probably strip out the 'options' => [
'connections' => [
'tcp' => 'Predis\Connection\PhpiredisStreamConnection',
'unix' => 'Predis\Connection\PhpiredisSocketConnection',
],
], I made a fork because the But anyways - all that is irrelevant, that Dockerfile should just work as-is. |
@francislavoie can you share the part of laravel websockets in docker-compose file, please. |
Sounds like you're running into #115 I prefer to run it in a separate container. I have these: There's really nothing special to show in my docker-compose file, I just point to the Dockerfile to build, and share a volume for the code between containers. |
@francislavoie I'm still getting the same issue, regardless that websockets container runs correctly, I get no traces in the dashboard when firing the event from tinker. FROM php:7.3.3-alpine
# FROM php:7.2-fpm
RUN apk add --no-cache \
wget \
curl \
# git \
shadow \
build-base \
autoconf \
# hiredis \
libxml2-dev \
zlib-dev \
libevent \
libevent-dev \
openssl-dev \
gmp-dev \
icu-dev
RUN docker-php-ext-install \
pcntl \
mbstring \
pdo \
pdo_mysql \
tokenizer \
xml \
sockets \
gmp \
bcmath \
intl
# Libevent
RUN pecl install event
RUN apk update
# Cleanup
# apk del .build-deps && \
RUN rm -rf /var/cache/apk/* && \
rm -rf /tmp/*
RUN mkdir -p /var/www
RUN groupmod -g 1000 www-data && \
usermod -u 1000 www-data
USER www-data
WORKDIR /var/www/html
EXPOSE 6001
CMD ["php", "artisan", "websockets:serve"] this is websockets service in docker-compoe ssms-sockets:
build:
context: ./docker/websockets
container_name: ssms-sockets
volumes:
- .:/var/www/html
ports:
- 6001:6001
networks:
backend:
aliases:
- ssms-sockets in the app container i'm exposing |
I'm having this same problem. Were you able to resolve this? I'll like to know how you did, if you were. Thanks |
greetings, I walk by here and I see that the last post, still persisted the problem, some will have solved it, I am in the same diatrive |
I've started to use ratchet that allows to in-websocket interactions. The issue in my case was mismatch with events. Ratchet works also much faster. |
I was searching and when looking at documents, broadcast-queue there was the information that was going to the queue and when I looked at the jobs, everything was really going there. When I changed it solved for me. On my docker, I didn't have to expose the My current configurationTesting with the pusher.
|
Uh oh!
There was an error while loading. Please reload this page.
Hello,
im trying to make Websocket work with my Dev Docker setup, but there is still some problem i cant figure out.
This is my docker-compose.yaml i start the Websocket Server in its own container its upp and running
The Server is up and runing:
websocket_1 | Starting the WebSocket server on port 6001...
broadcasting.php:
and the bootstrap.js:
When i refresh my page i get following error:

Sadly could not find anything similar to this Issue.
The text was updated successfully, but these errors were encountered: