forked from thixpin/ansible-lab
-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yaml
70 lines (63 loc) · 1.56 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
version: '3'
services:
control_node:
build:
context: .
dockerfile: dockerfiles/ansible.dockerfile # Path to the Dockerfile
image: control-node
container_name: control_node
tty: true
stdin_open: true
command: tail -f /dev/null
volumes:
- ./playbooks/:/home/ubuntu/playbooks/
networks:
ansible_lab_network:
ipv4_address: 172.20.0.10
web_node1:
build:
context: .
dockerfile: dockerfiles/nginx.dockerfile # Path to the Dockerfile
image: nginx-ssh
container_name: web_node1
volumes:
- ./authorized_keys:/root/.ssh/authorized_keys
networks:
ansible_lab_network:
ipv4_address: 172.20.0.11
web_node2:
image: nginx-ssh
container_name: web_node2
volumes:
- ./authorized_keys:/root/.ssh/authorized_keys
networks:
ansible_lab_network:
ipv4_address: 172.20.0.12
db_node1:
build:
context: .
dockerfile: dockerfiles/mysql.dockerfile # Path to the Dockerfile
image: mysql-ssh
container_name: db_node1
platform: linux/x86_64
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: ansible_lab
MYSQL_USER: ansible_user
MYSQL_PASSWORD: ansible_db_password
ports:
- "3306:3306"
volumes:
- ./authorized_keys:/root/.ssh/authorized_keys
- mysql_data:/var/lib/mysql
networks:
ansible_lab_network:
ipv4_address: 172.20.0.13
networks:
ansible_lab_network:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/16
volumes:
mysql_data: