-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
51 lines (48 loc) · 1.29 KB
/
docker-compose.yml
File metadata and controls
51 lines (48 loc) · 1.29 KB
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
services:
# Service for the SSH server that will host NGINX
ssh_server:
build:
context: ./ssh_server
container_name: ssh_server
hostname: ssh_server
ports:
- "2222:22"
volumes:
- ./ssh_server/sshd_config:/etc/ssh/sshd_config
networks:
- app_network
restart: unless-stopped
environment:
- TZ=Europe/Paris
command: >
bash -c "service ssh start &&
echo 'SSH server is up and running' &&
tail -f /dev/null"
# Service for the Ansible controller
ansible_controller:
build:
context: ./ansible_controller
container_name: ansible_controller
hostname: ansible_controller
depends_on:
- ssh_server
volumes:
- ./ansible:/home/ansible/ansible
networks:
- app_network
command: >
bash -c "sleep 10 &&
ansible -i ansible/inventory all -m ping &&
ansible-playbook -i ansible/inventory ansible/playbook.yml
tail -f /dev/null"
restart: on-failure
environment:
- ANSIBLE_HOST_KEY_CHECKING=False # Disable SSH key verification for development
- TZ=Europe/Paris
# network for the communication between services
networks:
app_network:
driver: bridge
# volumes to persist data
volumes:
ansible_data: