Follow the next steps:
-
Edit the
/etc/hosts
file and put the websites url:- 127.0.1.1 site1.com
- 127.0.1.1 site2.com
- 127.0.1.1 site3.com
-
Execute net command to create a new Docker network:
bash nginx/create-net.sh
-
Start the nginx container:
docker-compose -f "nginx/docker-compose.yml" up -d
-
Start the websites containers:
docker-compose -f "site1/docker-compose.yml" up -d docker-compose -f "site2/docker-compose.yml" up -d docker-compose -f "site3/docker-compose.yml" up -d
-
Access the website containers:
These configurations are based on nginx-proxy
Docker image.