[FEEDBACK] Docker compose
Thank you for taking the time to provide feedback! This is incredibly valuable for fine-tuning the software.
1. What were you trying to do? Docker compose tweaks
I'm no docker expert, so please let me know if this seems incorrect. But, in my setup, I have modified the docker compose file and wondered if this would be useful for others.
I've commented out the redis ports as all services are running in the same stack so doesn't need exposing to host (I assume)? Same goes for the ports for the postgres data base.
`# ports:
- "6379:6379" # Expose Redis port to the host`
`# ports:
- "5435:5432" # Expose PostgreSQL port to the host`
I've added this to the postgres database
healthcheck: test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}"] interval: 10s retries: 5 start_period: 30s timeout: 10s
Which then also allows me to add this to the flask and worker
depends_on: audiomuse-postgres: condition: service_healthy restart: true redis: condition: service_started
As I did have a few times of getting errors as the database wasn't ready before.
Thanks for reaching me. Can be more precise on which kind of feedback are you giving me?
I mean, is there an issue? or is a suggestion to improve in some way the deployment?
Sorry no issue.
I made those changes and wondered if they were some improvement but I don't really know docker well enough to know best practise.
It depends on what you are trying to achieve.
If you want to utilize workers across multiple machines, the ports of Redis and PostgreSQL need to be exposed, so the external workers can access them.
Otherwise, it would be best practice to remove the ports declaration. Ports exposed in a Dockerfile are automatically exposed to the Docker Network and don't require additional exposing through the ports property.
Thanks for all your feedback. I'm not looking any action needed on this topic, so I'm going to close.