???
This commit is contained in:
parent
c7d69b2af3
commit
82659b67e9
15
docker-traefik-nginxb/Vagrantfile
vendored
15
docker-traefik-nginxb/Vagrantfile
vendored
@ -73,8 +73,10 @@ Vagrant.configure("2") do |config|
|
||||
gpasswd -a vagrant docker
|
||||
fi
|
||||
mkdir -p docker/traefik && cd docker/traefik
|
||||
mkdir www
|
||||
echo "my.nginx" > www/index.html
|
||||
mkdir nginx
|
||||
echo "my.nginx" > nginx/index.html
|
||||
mkdir nginx2
|
||||
echo "my.nginx2" > nginx2/index.html
|
||||
#cat > docker-compose.yml <<-EOT
|
||||
cat > docker-compose.yml <<EOT
|
||||
version: '3'
|
||||
@ -97,9 +99,16 @@ services:
|
||||
# A container that exposes an API to show its IP address
|
||||
image: nginx:1.23-alpine
|
||||
volumes:
|
||||
- ./www:/usr/share/nginx/html:ro
|
||||
- ./nginx:/usr/share/nginx/html:ro
|
||||
labels:
|
||||
- "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
|
||||
docker compose up -d
|
||||
ip -br a
|
||||
|
Loading…
x
Reference in New Issue
Block a user