forked from dzmitry-papkou/e-shop-virtualization
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
121 lines (110 loc) · 2.48 KB
/
docker-compose.yml
File metadata and controls
121 lines (110 loc) · 2.48 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
version: '3.8'
services:
# Define the backend service
backend:
container_name: backend
build: ./backend
depends_on:
- database
environment:
- POSTGRES_URI=postgresql://mbsuperadmin:NeClownLast44*404*#Hahaha24-LS@database:5432/dh2p_database
networks:
- net1
# Define the frontend service
frontend:
container_name: frontend
build: ./frontend
ports:
- "4200:80" # Map port 80 in the container to port 4200 on the host
networks:
- net1
# Define the Postgre db service
database:
container_name: postgres
build: ./database
environment:
POSTGRES_USER: mbsuperadmin
POSTGRES_PASSWORD: NeClownLast44*404*#Hahaha24-LS
POSTGRES_DB: dh2p_database
volumes:
- db_data:/var/lib/postgresql/data
- ./scripts/init-postgres.sql:/docker-entrypoint-initdb.d/10-init-postgres.sql
- ./scripts/insert-data.sql:/docker-entrypoint-initdb.d/20-insert-data.sql
networks:
- net1
- net2
# Define the backup service
backup:
container_name: backup
build: ./backup
volumes:
- backup_data:/backup
environment:
POSTGRES_USER: mbsuperadmin
POSTGRES_PASSWORD: NeClownLast44*404*#Hahaha24-LS
POSTGRES_DB: dh2p_database
DATABASE_HOST: database
PGPASSWORD: NeClownLast44*404*#Hahaha24-LS
PGDATABASE: dh2p_database
depends_on:
- database
networks:
- net1
- net2
# Define the vhost1 service
vhost1:
container_name: vhost1
build: ./vhost1
depends_on:
- backend
- frontend
networks:
- net1
# Define the vhost2 service
vhost2:
container_name: vhost2
build: ./vhost2
networks:
- net2
# Define the Caddy reverse proxy
proxy:
container_name: proxy
build: ./proxy
ports:
- "80:80"
- "443:443"
volumes:
- ./proxy/Caddyfile:/etc/caddy/Caddyfile:ro
depends_on:
- vhost1
- vhost2
networks:
- net1
- net2
- net3
# Define the Ansible automation service
ansible-automation:
container_name: ansible-automation
build:
context: ./ansible-automation
dockerfile: Dockerfile
command: sleep infinity
volumes:
- ./ansible-automation:/opt
- /var/run/docker.sock:/var/run/docker.sock
depends_on:
- vhost1
- vhost2
- database
- proxy
networks:
- net1
- net2
- net3
volumes:
db_data:
backup_data:
networks:
net1:
net2:
net3: