Depends_on only checks if the container is started, not if the application is healthy and available, you need a health check on the dockerproxy
socketproxy:
healthcheck:
test:
[
"CMD-SHELL",
"<Successful command here>"
]
interval: 10s
retries: 3
start_period: 5s
timeout: 5s
traefik:
depends_on:
socketproxy:
condition: service_healthy