This commit is contained in:
“Albert 2022-11-17 11:38:22 +01:00
parent c7d69b2af3
commit 82659b67e9

View File

@ -73,8 +73,10 @@ Vagrant.configure("2") do |config|
gpasswd -a vagrant docker gpasswd -a vagrant docker
fi fi
mkdir -p docker/traefik && cd docker/traefik mkdir -p docker/traefik && cd docker/traefik
mkdir www mkdir nginx
echo "my.nginx" > www/index.html echo "my.nginx" > nginx/index.html
mkdir nginx2
echo "my.nginx2" > nginx2/index.html
#cat > docker-compose.yml <<-EOT #cat > docker-compose.yml <<-EOT
cat > docker-compose.yml <<EOT cat > docker-compose.yml <<EOT
version: '3' version: '3'
@ -97,9 +99,16 @@ services:
# A container that exposes an API to show its IP address # A container that exposes an API to show its IP address
image: nginx:1.23-alpine image: nginx:1.23-alpine
volumes: volumes:
- ./www:/usr/share/nginx/html:ro - ./nginx:/usr/share/nginx/html:ro
labels: labels:
- "traefik.http.routers.nginx.rule=Host(`my.nginx`)" - "traefik.http.routers.nginx.rule=Host(`my.nginx`)"
nginx2:
# A container that exposes an API to show its IP address
image: nginx:1.23-alpine
volumes:
- ./nginx2:/usr/share/nginx/html:ro
labels:
- "traefik.http.routers.nginx2.rule=Host(`my.nginx2`)"
EOT EOT
docker compose up -d docker compose up -d
ip -br a ip -br a