migalabs / armiarma

Armiarma is a Libp2p open-network crawler with a current focus on Ethereum's CL network
https://monitoreth.io
MIT License
36 stars 13 forks source link

Make port for binding to db docker container configurable #62

Closed santi1234567 closed 10 months ago

santi1234567 commented 10 months ago

Description

Maybe there is something I missed but the binding of port 5432 for the connection to the DB docker container can be a problem if the port is already in use. It would be nice to be able to configure it through an env variable, to avoid having to change the docker-compose file (or the other service using the port.

cortze commented 10 months ago

Hey @santi1234567 , are we talking about this:

[docker-compose.yaml]
db:
.....
ports:
        - "127.0.0.1:5432:5432"

or

[.env_template]
CRAWLER_PSQL_ENDP="postgres://user:password@db:5432/armiarmadb"

For both cases, I understand that it's nice to have a configurable docker-compose file, but the idea of this one is to offer a basic one, not a production one. From my understanding, docker-compose files are super specific for each use case, so they are barely offered in other repos (as anyone can build their own one using the Dockerfile).

@tdahar do you think that it would make sense to offer a more customizable docker-compose file? we are not even using this one for our production crawler

tdahar commented 10 months ago

If we are not using this one for production, which one are we using? I think it would be good that this could be customizable if it is easy to implement.

Same thing happens with our nginx services, when we have several we need to configure the port. So if we run Armiarma in a machine that already has the port in use, having the customization implemented would make it a lot easier.

Anyways, I don't think it is critical.

santi1234567 commented 10 months ago

I was talking about this, more in the shoes of a user(dev) who wants to launch the script with a minimal configuration. But I do see the point that the specifics of any person/team that would want to run the script would require in most cases a personalized deployment so it wouldn't make sense to over-complicate the configuration provided. I hadn't thought about it in this way.

Hey @santi1234567 , are we talking about this:

[docker-compose.yaml]
db:
.....
ports:
        - "127.0.0.1:5432:5432"

And for sure, this is just a really small detail

Anyways, I don't think it is critical.

cortze commented 10 months ago

closed with #63