Mongo and Tiled in a Private Network
In the current configuration it is not possible to access the portainerCE service at https://localhost:9443
or http://localhost:9000
because it is running in a private network with no ports exposed.
If the ports are exposed (8000 and 9443) then the service clashes with the Tiled service which is running on port 8000
If we put Tiled and mongoDB on the same private network and expose ports then all the services can run at the same time.
In this merge request I:
- Modify docker-compose to:
- create a private network called
mongo_network
with the IP range172.22.0.0/24
- add the tiled and mongodb services to the private
mongo_network
network - assign the mongodb service the IP adderss
172.22.0.4
- map the port 8000 to 8001 so that the Tiled service is reachable on the host at
localhost:8001
- modify the command called by the tiled service at startup to bind it to the localhost ip address
0.0.0.0
- make portainerCE use the ports 8000 and 9443 of the host. It would also work with host networking
- create a private network called
- Modify the tiled config.yml:
- Use the new mongodb ip
172.22.0.4
- not require auth for the read access of data. (unrelated change)
- Use the new mongodb ip
To test:
- I checked I could reach portainerCE at
https://localhost:9443
- I checked I could reach tiled at
localhost:8001
- I modified the /etc/environment file to use the variable
TILED_URL
=localhost:8001
then restarted the machine - I started bluesky with
bluesky_start
- I ran a scan plan and checked that the tiled writer callback was correctly able to write data to tiled and mongodb, then checked I could read again.