Emulating production environment on local machine with Docker #4230
-
I'm pretty new to Docker, and I'm following the Getting Up and Running Locally with Docker guide as my reference. I'm specifically trying to learn more about this idea:
Which implies that I should be able to, in theory, use In practice, this doesn't work for a few reasons:
I thought I might be able to work around this by adding some entires to my local
Even with this, these URLs each fail in their own ways in my browser:
I've tried looking through |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi, ok I think I've answered my own question. Setting my FQDN to 127.0.0.1 in my It looks like what happened is I wasn't waiting long enough for my Django container to finish booting up. My production container is set to push to S3, and I believe the After waiting about 4 minutes, it finished booting and it appears to be working! |
Beta Was this translation helpful? Give feedback.
Hi, ok I think I've answered my own question.
Setting my FQDN to 127.0.0.1 in my
/etc/hosts
file is the key trick. The others aren't accurate because those containers don't expose their ports directly anyway.It looks like what happened is I wasn't waiting long enough for my Django container to finish booting up. My production container is set to push to S3, and I believe the
collectstatic
action was working in the background and so that's why traefik was (correctly) reporting that my django container was not yet ready to receive traffic.After waiting about 4 minutes, it finished booting and it appears to be working!