├── README.md ├── a └── Dockerfile ├── b └── Dockerfile └── docker-compose.yaml /README.md: -------------------------------------------------------------------------------- 1 | Don't forget to add this 2 lines in your /etc/hosts file: 2 | 3 | ``` 4 | 127.0.0.1 hosta 5 | 127.0.0.1 hostb 6 | ``` 7 | -------------------------------------------------------------------------------- /a/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM httpd:2.4 2 | RUN echo "

A

App A works!" > /usr/local/apache2/htdocs/index.html 3 | -------------------------------------------------------------------------------- /b/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM httpd:2.4 2 | RUN echo "

B

App B works!" > /usr/local/apache2/htdocs/index.html 3 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | a: 2 | build: a 3 | environment: 4 | VIRTUAL_HOST: a.domain.com 5 | restart: always 6 | 7 | b: 8 | build: b 9 | environment: 10 | VIRTUAL_HOST: b.domain.com 11 | restart: always 12 | 13 | nginx-proxy: 14 | image: jwilder/nginx-proxy 15 | ports: 16 | - "80:80" 17 | - "443:443" 18 | volumes: 19 | - /var/run/docker.sock:/tmp/docker.sock:ro 20 | 21 | restart: always 22 | privileged: true 23 | --------------------------------------------------------------------------------