Closed tsauvajon closed 3 years ago
Before this PR:
In one terminal:
$ docker-compose run reverseproxy
In another terminal:
$ curl http://127.0.0.1:8081 curl: (7) Failed to connect to 127.0.0.1 port 8081: Connection refused
This is because the entry command of the reverseproxy container is bash, so it won't run nginx at all.
reverseproxy
bash
Also, docker-compose up exits immediately (since it's starting with a non-interactive bash CMD).
docker-compose up
With this PR, both docker-compose up and docker-compose run reverseproxy yield the expected results:
docker-compose run reverseproxy
$ curl http://127.0.0.1:8081 <html><body><h1>It works!</h1></body></html> $ curl http://127.0.0.1:8080 <!DOCTYPE html> <html> <head> <title>Welcome to nginx!</title> ...
A note for depends_on: reverse proxy depends on the other two services (it cannot run by itself, otherwise it routes to nothing). Apache and Nginx can run perfectly well on their own, they don't depend on the reverse proxy.
depends_on
Closing because of inactivity, I still think it makes sense to merge if you see this
Before this PR:
In one terminal:
In another terminal:
This is because the entry command of the
reverseproxy
container isbash
, so it won't run nginx at all.Also,
docker-compose up
exits immediately (since it's starting with a non-interactivebash
CMD).With this PR, both
docker-compose up
anddocker-compose run reverseproxy
yield the expected results:A note for
depends_on
: reverse proxy depends on the other two services (it cannot run by itself, otherwise it routes to nothing). Apache and Nginx can run perfectly well on their own, they don't depend on the reverse proxy.