Basic Traefik Setup
This commit is contained in:
parent
e16f33802b
commit
aba56da99a
1
Vagrantfile
vendored
1
Vagrantfile
vendored
@ -4,6 +4,7 @@
|
|||||||
Vagrant.configure("2") do |config|
|
Vagrant.configure("2") do |config|
|
||||||
config.vm.box = "debian/buster64"
|
config.vm.box = "debian/buster64"
|
||||||
config.vm.network "forwarded_port", host: 8080, guest: 8080
|
config.vm.network "forwarded_port", host: 8080, guest: 8080
|
||||||
|
config.vm.network "forwarded_port", host: 8000, guest: 8000
|
||||||
config.vm.synced_folder ".", "/vagrant", disabled: true
|
config.vm.synced_folder ".", "/vagrant", disabled: true
|
||||||
|
|
||||||
# Machine Name
|
# Machine Name
|
||||||
|
@ -37,4 +37,5 @@
|
|||||||
|
|
||||||
roles:
|
roles:
|
||||||
- docker
|
- docker
|
||||||
|
- traefik
|
||||||
- wordpress
|
- wordpress
|
||||||
|
16
roles/traefik/tasks/main.yml
Normal file
16
roles/traefik/tasks/main.yml
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
- name: Install Traefik Configuration
|
||||||
|
copy:
|
||||||
|
src: traefik.yml
|
||||||
|
dest: traefik.yml
|
||||||
|
|
||||||
|
- name: Start Traefik container
|
||||||
|
docker_container:
|
||||||
|
name: traefik
|
||||||
|
image: traefik:2.0.2
|
||||||
|
restart_policy: always
|
||||||
|
ports:
|
||||||
|
- 8000:80
|
||||||
|
- 8080:8080
|
||||||
|
volumes:
|
||||||
|
- ./traefik.yml:/etc/traefik/traefik.yml
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
8
roles/traefik/traefik.yml
Normal file
8
roles/traefik/traefik.yml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Docker configuration backend
|
||||||
|
providers:
|
||||||
|
docker:
|
||||||
|
defaultRule: "Host(`{{ trimPrefix `/` .Name }}.docker.localhost`)"
|
||||||
|
|
||||||
|
# API and dashboard configuration
|
||||||
|
api:
|
||||||
|
insecure: true
|
@ -15,7 +15,6 @@
|
|||||||
name: wordpress
|
name: wordpress
|
||||||
image: wordpress:5.2.3
|
image: wordpress:5.2.3
|
||||||
restart_policy: always
|
restart_policy: always
|
||||||
ports: 8080:80
|
|
||||||
volumes: wordpress:/var/www/html
|
volumes: wordpress:/var/www/html
|
||||||
links:
|
links:
|
||||||
- mariadb
|
- mariadb
|
||||||
|
Loading…
Reference in New Issue
Block a user