-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
97 lines (90 loc) · 2.31 KB
/
docker-compose.yml
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
version: '3.7'
services:
client_service:
build: ./client
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
env_file:
- .env
volumes:
- ./client/:/app/
ports:
- 8001:8000
environment:
- DATABASE_URI=${DB_CLIENT}
- CLIENT_SERVICE_URL=http://client_service:8000/api/v1/users
- BOOK_SERVICE_URL=http://books_service:8000/api/v1/books
depends_on:
- client_db
client_db:
image: postgres:12.3-alpine
env_file:
- .env
volumes:
- ./postgres_data_client:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_ADMIN_PASSWORD}
- POSTGRES_DB=client_db_dev
books_service:
build: ./books
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
env_file:
- .env
volumes:
- ./books/:/app/
ports:
- 8002:8000
environment:
- DATABASE_URI=${DB_BOOKS}
- CLIENT_SERVICE_URL=http://client_service:8000/api/v1/users
- BOOK_SERVICE_URL=http://books_service:8000/api/v1/books
depends_on:
- books_db
books_db:
image: postgres:12.3-alpine
env_file:
- .env
volumes:
- ./postgres_data_books:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_ADMIN_PASSWORD}
- POSTGRES_DB=books_db_dev
admin_service:
build: ./admin
command: uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
env_file:
- .env
volumes:
- ./admin/:/app/
ports:
- 8003:8000
environment:
- DATABASE_URI=${DB_ADMIN}
- CLIENT_SERVICE_URL=http://client_service:8000/api/v1/users
- BOOK_SERVICE_URL=http://books_service:8000/api/v1/books
depends_on:
- admin_db
admin_db:
image: postgres:12.3-alpine
env_file:
- .env
volumes:
- ./postgres_data_admin:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_ADMIN_PASSWORD}
- POSTGRES_DB=admin_db_dev
nginx:
image: nginx:latest
container_name: cowry_service_nginx
ports:
- "8080:8080"
env_file:
- .env
volumes:
- ./nginx_config.conf:/etc/nginx/conf.d
depends_on:
- client_service
- books_service
- admin_service