How to create container without tweaking postgresql and exposing port publicly?

Reverse proxies, SSL termination, web servers, helm charts, integrations, batch files, anything having to do with installing Mayan.
Post Reply
noddy09
Posts: 2
Joined: Sat Mar 28, 2020 5:50 am

How to create container without tweaking postgresql and exposing port publicly?

Post by noddy09 »

Hi,

I'm trying to avoid postgresql as container. Instead I'm creating docker container of mayan-edms such way that it can access postgresql without making any tweaks to it, like adding exceptions in 'listen_address', etc.

Everything is well and good with creation of container using '--network=host' except the part where I can't change port number of mayan-edms and I can't keep port private only. for example, requesting on localhost:8000 should give proper response, but if i request on 10.1.1.1:8000 it should return connection refused or 404. Reason behind this is: no one wants to keep any port publicly open except 80 or 443.

Is it possible to deploy mayan-edms without tweaking postgresql, and without exposing any port publicly?

Regards,
NoDDy09
User avatar
rosarior
Developer
Developer
Posts: 651
Joined: Tue Aug 21, 2018 3:28 am
Location: Puerto Rico
Contact:

Re: How to create container without tweaking postgresql and exposing port publicly?

Post by rosarior »

If you use Docker networks, there is no need to expose the port, each container in the same network will be able to access their ports but hosts outside the network won't be able to.

Take a look at the Docker Compose file. In that file PostgreSQL does not exposes the ports. The Mayan container is able to access PostgreSQL and all the services because it is on the same network.

I think you can use Linux sockets to talk to PostgreSQL but that is beyond what is normally supported.
Post Reply