Push Server is a NodeJS app built by Bitrix Inc. to handle realtime communications within Bitrix platform. It is usually installed as part of Bitrix Environment.
If you'd like to run Bitrix24 in Docker on your own making realtime comms, i.e. chat and video calls to work is tricky. This image contains Bitrix Push Server from original Bitrix Environment package and can easily be placed into your existing project. The image is tested to work with Docker Compose and Docker Swarm.
You have to start Redis first.
$ docker run --name bitrix-push-server --link redis:redis -d ikarpovich/bitrix-push-server
... in Docker Swarm
or via Docker Compose
redis:
image: redis:6.0.5-alpine3.12_1
container_name: redis
restart: always
push-pub:
image: bx-push-server:2.0_1
container_name: push-pub
environment:
- MODE=pub
depends_on:
- redis
restart: always
push-sub:
image: bx-push-server:2.0_1
container_name: push-sub
environment:
- MODE=sub
depends_on:
- redis
restart: always
networks:
default:
external:
name: bx
- Настройка адреса для публикации команд со стороны сервера:
- Путь для публикации команд: http://push-pub:8010/bitrix/pub/
- Код-подпись для взаимодействия с сервером: IMbEDEnTANDiSPATERSIVeRptUGht
- Настройка адреса для публикации команд со стороны клиента:
- Путь для публикации команд (HTTP): http://push-pub:8010/bitrix/sub
- Путь для чтения команд (HTTPS): https://push-pub:8010/bitrix/sub
Hostname to bind daemon to, 0.0.0.0
by default
Port to bind daemon to, 80
by default
Redis hostname, redis
by default
Redis port, 6379
by default
Security key, has to match one in Push & Pull system module settings
Mode should be either pub
or sub
. You have to launch two containers with each mode to work.
Для работы модуля Push&Pull в конфиге Nginx:
location /bitrix/pub/ {
# IM doesn't wait
proxy_ignore_client_abort on;
proxy_pass http://push-pub:8010;
}
location ~* ^/bitrix/subws/ {
access_log off;
proxy_pass http://push-sub:8010;
# http://blog.martinfjordvald.com/2013/02/websockets-in-nginx/
# 12h+0.5
proxy_max_temp_file_size 0;
proxy_read_timeout 43800;
proxy_http_version 1.1;
proxy_set_header Upgrade $replace_upgrade;
proxy_set_header Connection $connection_upgrade;
}
location ~* ^/bitrix/sub/ {
access_log off;
rewrite ^/bitrix/sub/(.*)$ /bitrix/subws/$1 break;
proxy_pass http://push-sub:8010;
proxy_max_temp_file_size 0;
proxy_read_timeout 43800;
}
location ~* ^/bitrix/rest/ {
access_log off;
proxy_pass http://push-pub:8010;
proxy_max_temp_file_size 0;
proxy_read_timeout 43800;
}
License for this image is MIT. Bitrix and Bitrix Environment, Bitri Push Server are products licensed by Bitrix Inc. under their license terms.