-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose-networks.yaml
More file actions
66 lines (62 loc) · 1.3 KB
/
docker-compose-networks.yaml
File metadata and controls
66 lines (62 loc) · 1.3 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
services:
db:
image: mysql:8.0
container_name: mysql-db
environment:
MYSQL_ROOT_PASSWORD: db_password_123
MYSQL_DATABASE: example
volumes:
- db-data:/var/lib/mysql
ports:
- "3306:3306"
networks:
- db-network
restart: unless-stopped
extra_hosts:
- "go-backend:172.17.0.1"
- "nginx:172.17.0.1"
go-backend:
image: mmsaeed509/go-app:v1
container_name: Test-GoApp
volumes:
- ./backend/db-password.txt:/run/secrets/db-password
ports:
- "10000:8000"
depends_on:
- db
networks:
- backend-network
restart: unless-stopped
extra_hosts:
- "db:172.17.0.1"
- "nginx:172.17.0.1"
nginx:
image: mmsaeed509/go-app-nginx:v3
container_name: nginx-proxy
volumes:
- ./nginx-2/nginx.conf:/etc/nginx/nginx.conf
- nginx-ssl:/etc/nginx/ssl
ports:
- "80:80"
- "443:443"
depends_on:
- go-backend
networks:
- nginx-network
restart: unless-stopped
extra_hosts:
- "db:172.17.0.1"
- "go-backend:172.17.0.1"
volumes:
db-data:
nginx-ssl:
networks:
db-network:
driver: bridge
name: db-network
backend-network:
driver: bridge
name: backend-network
nginx-network:
driver: bridge
name: nginx-network