In the docker-compose.yml file, the healthcheck section has port 5000 hardcoded, which does not match the FLASK_PORT setting.
You can simple add a variable instead of a port.
However, I suggest considering a different change instead.
Inside the container, I would keep a static port—for example, 5000—and set the FLASK_PORT variable only for external mapping.
After this change, you'll be able to
explicitly expose a port in the Dockerfile and move the health check there.
In the `docker-compose.yml` file, the `healthcheck` section has port 5000 hardcoded, which does not match the `FLASK_PORT` setting.
You can simple add a variable instead of a port.
However, I suggest considering a different change instead.
Inside the container, I would keep a static port—for example, 5000—and set the `FLASK_PORT` variable only for external mapping.
After this change, you'll be able to
explicitly expose a port in the Dockerfile and move the health check there.
<!-- github-sync-id:5229314794 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In the
docker-compose.ymlfile, thehealthchecksection has port 5000 hardcoded, which does not match theFLASK_PORTsetting.You can simple add a variable instead of a port.
However, I suggest considering a different change instead.
Inside the container, I would keep a static port—for example, 5000—and set the
FLASK_PORTvariable only for external mapping.After this change, you'll be able to
explicitly expose a port in the Dockerfile and move the health check there.