Docker Health Check

Anything look wrong here to you guys?
32 Replies
Perfect
Perfect•2y ago
the health check seems to be acting very weird
Grey
Grey•2y ago
weird how?
Perfect
Perfect•2y ago
its not working @0xahmad probably should have clarified that haha it makes the db just exit
Grey
Grey•2y ago
I don't do health checks in docker-compose but did you try the test with
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
// or
test: ["CMD-SHELL", "sh -c 'pg_isready -U postgres -d dbname'"]
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"]
// or
test: ["CMD-SHELL", "sh -c 'pg_isready -U postgres -d dbname'"]
?
Perfect
Perfect•2y ago
I did, but it turns out this is exactly the same as what I have now, CMD SHELL is implied I solved it, turns out it actually was unhealthy and I was getting some postgres errors I was not able to see at first in the vastness of logs I was getting
Grey
Grey•2y ago
Cool, I was gonna say connect a volume with the logs dir, and check them
Perfect
Perfect•2y ago
yah, found them in docker desktop actually wish there was a way to just see logs for a certain service probably is i just dont know it my docker compose terminal just spits out every service together its so much
Grey
Grey•2y ago
i think you can stream logs of each container, I just never tried it out
Perfect
Perfect•2y ago
yeah might have to look into that later or just use docker desktop thx for ur help tho, much appreciated! @0xahmad oh and also
Grey
Grey•2y ago
?
Perfect
Perfect•2y ago
you said you dont do health checks in docker compose, how do u do them? (if at all)
Grey
Grey•2y ago
I moved to k8 so I do my health chesk in it now it's connected to a monitoring system which keeps track of what svc is healthy and not
Perfect
Perfect•2y ago
ahhh ok havent learned kubernetes yet
Grey
Grey•2y ago
I only use docker-compose for local dev deployment is always either k8 or cloud
Perfect
Perfect•2y ago
oh so we can switch over relatively easy?
Grey
Grey•2y ago
if you don't need it then stick to what you know 👋
Perfect
Perfect•2y ago
dont need it but yeah probably cool to try it out haha
Grey
Grey•2y ago
not really it's a learning curve but if you know you'll need it then it's good to learn it
Perfect
Perfect•2y ago
school project gives us extra credit for it so might try it out
Grey
Grey•2y ago
I'm working on larger projects so I need to know devops inside out
Perfect
Perfect•2y ago
yeah I bet
Grey
Grey•2y ago
that's nice you should learn it
Perfect
Perfect•2y ago
docker compose is only for a single machine right? so not meant for scaling
Grey
Grey•2y ago
it's not hard, just a hek ton of yaml to write
Perfect
Perfect•2y ago
just meant for setting up containers easier?
Grey
Grey•2y ago
scratch that, checkout pulumi, you can code your configurations
Perfect
Perfect•2y ago
i figured a lot of setup/config yeah
Grey
Grey•2y ago
no I think it's scalable docker-swarm from what I remember
Perfect
Perfect•2y ago
oh right swarm so many options
Grey
Grey•2y ago
docker is everywhere, it's just more abstractions over that k8 is just an abstraction over docker(or any other containerizer)
Perfect
Perfect•2y ago
more abstractions yay abstractions never end lmao
Grey
Grey•2y ago
yea sad story haha you have to weigh the abstraction cost over the requirements. I'd say it's healthy as long as you're careful
Want results from more Discord servers?
Add your server