It is easy to assume docker compose run behaves like up for a single service. It does not publish the ports from your compose file, so a web app can look dead when it is only closed.
The docs say it plainly: run skips the service’s configured ports so they do not collide with ports already open. To get them back, add --service-ports (short form -P):
docker compose run --rm --service-ports web
That starts one container of web with every port from its ports: list mapped to the host. It works well for running a web service in the foreground and watching its output while you test a setting. To publish just one port, use -p 8081:80 and keep the rest closed. You can also replace the command and keep the ports, for example docker compose run --rm --service-ports web sh for a shell in a container the host can reach.
Caveat: if the normal stack is already running and holds the same host port, the one-off container cannot bind it and fails to start. Stop that service first, or pick another host port with -p. Linked services that are not running get started for you unless you add --no-deps.
Further reading: docker compose run