Yep, the trains server is basically a docker-compose based service.
All you have to do is change the ports in the docker-compose.yml
file.
If you followed the instructions in the docs you should find that file in /opt/trains/docker-compose.yml
and then you will see that there are multiple services ( apiserver
, elasticsearch
, redis
etc.) and in each there might be a section called ports
which then states the mapping of the ports.
The number on the left, is the port you want to change.
So for example, if you go to the webserver
(which is the service that you interact with when you see the trains server dashboard in your browser) you'll see the ports
section has the value of "8080:80"
- this means that you will find the dashboard on port 8080
- simply change that to "8765:80"
for example, and then you will find it on port 8765
. The effect only takes change after you restart the server, to do so run the commands docker-compose -f /opt/trains/docker-compose.yml down
followed by docker-compose -f /opt/trains/docker-compose.yml up -d
. Note: You should never change the number on the right side! .
More information about ports and docker-compose can be found in https://docs.docker.com/compose/compose-file/#ports
Disclaimer - I'm not part of Allegro, just a user like you 🙂