From 23d56b21853640c8d29989563f14c0652da0f1e1 Mon Sep 17 00:00:00 2001 From: Fabio Date: Wed, 5 Feb 2025 21:20:42 +0800 Subject: [PATCH] Aggiorna README.md --- README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) 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 :