D
D
Dmitry Tarasov2020-01-24 01:07:16
Node.js
Dmitry Tarasov, 2020-01-24 01:07:16

How to separate the environment for 2 applications on nodejs on the same server?

Hello!
On the same server on the dev.site.com:2088 domain and the production site.com:2084 domain, the same nodejs applications are running.
The app itself is here .
It does the following, authorizes the user through socket.io and subscribes to different channels in the radish.
But when I send a message on prod to user 1 from user 2, the messages go to both prod and dev, what could be the reason?
How does sending messages work?
The broker receives a message in the form of json, I take from it the user id for whom it is and send it to the user's room.
The room is created on the basis of user_room_+id
, maybe due to the fact that the same rooms are created, such as both there and there are the same users and create rooms.
And 2 two applications have some kind of global scope that these rooms fall into?
If yes, why does it happen like that?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor, 2020-01-24
@IgorPI

Run your applications in two different docker containers with docker-compose

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question