Improve install and modify Traefik IP restriction
This commit is contained in:
parent
0455466dfd
commit
0ea81138e2
15
Vagrantfile
vendored
15
Vagrantfile
vendored
@ -2,11 +2,18 @@ Vagrant.configure("2") do |config|
|
|||||||
config.vm.box = "debian/bookworm64"
|
config.vm.box = "debian/bookworm64"
|
||||||
config.vm.provision "shell", inline: <<-SHELL
|
config.vm.provision "shell", inline: <<-SHELL
|
||||||
set -xe
|
set -xe
|
||||||
apt-get update
|
|
||||||
apt-get install -y curl
|
# Install Docker
|
||||||
curl -fsSL https://get.docker.com | sh
|
which curl &>/dev/null || (apt-get update && apt-get install -y curl)
|
||||||
docker swarm init
|
which docker &>/dev/null || curl -fsSL https://get.docker.com | sh
|
||||||
|
|
||||||
|
# Swarm?
|
||||||
|
[ ! "$(docker info | grep -c 'Swarm: active')" -eq 1 ] && docker swarm init
|
||||||
|
|
||||||
|
# Start Traefik compose
|
||||||
|
mkdir -p /vagrant/traefik/letsencrypt
|
||||||
cd /vagrant/traefik || exit 1
|
cd /vagrant/traefik || exit 1
|
||||||
docker compose up -d
|
docker compose up -d
|
||||||
|
|
||||||
SHELL
|
SHELL
|
||||||
end
|
end
|
||||||
|
@ -35,7 +35,8 @@ services:
|
|||||||
- "traefik.http.routers.traefik.middlewares=localonly"
|
- "traefik.http.routers.traefik.middlewares=localonly"
|
||||||
- "traefik.http.routers.traefik.service=api@internal"
|
- "traefik.http.routers.traefik.service=api@internal"
|
||||||
- "traefik.http.routers.traefik.tls=true"
|
- "traefik.http.routers.traefik.tls=true"
|
||||||
- "traefik.http.middlewares.localonly.ipwhitelist.sourcerange=10.0.0.0/8"
|
#- "traefik.http.middlewares.localonly.ipwhitelist.sourcerange=10.0.0.0/8"
|
||||||
|
- "traefik.http.middlewares.localonly.ipwhitelist.sourcerange=172.16.0.0/12,10.0.0.0/8" # vagrant verison
|
||||||
whoami:
|
whoami:
|
||||||
image: "traefik/whoami"
|
image: "traefik/whoami"
|
||||||
networks:
|
networks:
|
||||||
|
0
traefik/letsencrypt/acme.json
Normal file
0
traefik/letsencrypt/acme.json
Normal file
Loading…
Reference in New Issue
Block a user