Commit cf787fd
bigjohncodes
Fix Docker networking race condition on first startup
- Add health check to Traefik proxy with ping endpoint
- Make backend depend on proxy being healthy before starting
- Ensures Docker networks are fully initialized before backend binds ports
- Prevents connection timeout issues on first 'docker compose up'
This fixes a race condition where the backend container would start
and bind to port 8000 before Docker's network bridges were fully
configured, causing connection timeouts from the host machine.
The fix ensures the backend waits for the proxy (Traefik) to be
healthy before starting, which guarantees all network routes and
port forwarding rules are properly established.1 parent fa87951 commit cf787fd
1 file changed
+11
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
15 | 21 | | |
16 | 22 | | |
17 | 23 | | |
| |||
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| 43 | + | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
59 | 67 | | |
60 | 68 | | |
61 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
0 commit comments