4007 mapping is no longer needed.
Set it up
1
Add Traefik and the labels
Edit Put your domain in the
docker-compose.yaml from the Compose repository. Add labels to the postqueen service, remove its ports: lines, and add a traefik service:docker-compose.yaml
Host rule and your address in acme.email. Keep the existing volumes: entries and add traefik-letsencrypt to them.traefik.enable=trueis required, becauseexposedbydefault=falsemakes Traefik ignore every container without it.- Removing
ports:frompostqueenmatters: left in place, PostQueen also answers on host port 4007 over plain HTTP, past Traefik. readTimeoutis raised because Traefik stops reading a request after 60 seconds by default, which cuts off a large upload on a slow connection. PostQueen accepts files up to 1 GB.providers.docker.networktells Traefik which network to reach PostQueen on, since thepostqueencontainer is on two. It takes the network’s full name, which Compose prefixes with the project folder’s name:docker network lsshows it.
2
Start it
3
Tell PostQueen its address
Put the public address in the Keep The database, Redis and Temporal keep running. Avoid
.env file next to docker-compose.yaml. The shipped Compose file
reads that file and fills these three values into the postqueen service, so there is no YAML to
edit:/api on the last one, and leave off trailing slashes. Leave BACKEND_INTERNAL_URL as it
ships, http://localhost:3000: it is the path from the web app to the API inside the container,
not a public address.Recreate the app container so it reads the new values. A plain docker restart or
docker compose restart keeps the old container and its old environment.In the folder that holds docker-compose.yaml, recreate only the postqueen service:docker compose down for a settings change: on
a host that runs other Compose services in the same project, it stops them too. On Kubernetes, see
Kubernetes with Helm.4
Check it
HTTP/2 200 with a certificate from Let’s Encrypt, and a sign-in that holds in the browser.buffering middleware to this router.
If it does not work
404 page not found from Traefik
404 page not found from Traefik
The router was not created. The usual cause is a missing
traefik.enable=true label, or a Host rule that does not match the name you open.The browser warns about the certificate
The browser warns about the certificate
Traefik is serving its default self-signed certificate because the ACME request failed.
docker compose logs traefik gives the reason, most often DNS that does not point here yet or port 80 blocked.curl http://localhost:4007 no longer answers
curl http://localhost:4007 no longer answers
That is expected once
ports: is removed: PostQueen is reachable only through Traefik. To check the container itself: docker compose exec postqueen node -e "require('http').get('http://localhost:5000/',r=>console.log(r.statusCode))" prints 200.Gateway Timeout or Bad Gateway
Gateway Timeout or Bad Gateway
Traefik cannot reach the container. Check that both services are on
postqueen-network, that providers.docker.network names it as docker network ls shows it, and that the service label says port 5000, not 4007.