diff --git a/README.md b/README.md index 2aa38ff..c075bef 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,16 @@ docker run --detach \ --volume /var/run/docker.sock:/tmp/docker.sock:ro \ nginxproxy/nginx-proxy:1.6 ``` - +```docker-compose +services: + nginx-proxy: + image: nginxproxy/nginx-proxy + restart: always + ports: + - "80:80" + volumes: + - "/var/run/docker.sock:/tmp/docker.sock" +``` Then start any containers (here an nginx container) you want proxied with an env var `VIRTUAL_HOST=subdomain.yourdomain.com` ```console @@ -29,7 +38,11 @@ docker run --detach \ --env VIRTUAL_HOST=foo.bar.com \ nginx ``` - +```docker-compose + environment: + - VIRTUAL_HOST=git.patachina.casacam.net + - VIRTUAL_PORT=3000 +``` Provided your DNS is setup to resolve `foo.bar.com` to the host running nginx-proxy, a request to `http://foo.bar.com` will then be routed to a container with the `VIRTUAL_HOST` env var set to `foo.bar.com` (in this case, the **your-proxied-app** container). The containers being proxied must :