-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
153 lines (150 loc) · 3.73 KB
/
docker-compose.yml
File metadata and controls
153 lines (150 loc) · 3.73 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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
version: "3.1"
services:
apigateway:
container_name: apigateway_api
hostname: api_gateway-service
profiles: [dev, backend]
pull_policy: always
restart: always
image: hfmartinez/object_detection:api_gateway
platform: linux/amd64
build:
context: ./microservices/api_gateway
dockerfile: ./Dockerfile
command: bash -c "uvicorn microservices.api_gateway.app:app --port=4500 --host=0.0.0.0"
ports:
- "127.0.0.1:8000:4500"
env_file:
- ./microservices/api_gateway/.env.dev
depends_on:
db:
condition: service_healthy
networks:
vpcbr:
ipv4_address: 10.5.0.10
object-detection:
container_name: object_detection_api
hostname: object-detection-service
profiles: [dev, backend]
pull_policy: always
restart: always
image: hfmartinez/object_detection:object-detection
platform: linux/amd64
build:
context: ./microservices/object_detection
dockerfile: ./Dockerfile
command: bash -c "uvicorn microservices.object_detection.app:app --port=6000 --host=0.0.0.0"
depends_on:
db:
condition: service_healthy
env_file:
- ./microservices/object_detection/.env.dev
networks:
vpcbr:
ipv4_address: 10.5.0.11
reports:
container_name: reports_api
hostname: reports-service
profiles: [dev, backend]
pull_policy: always
restart: always
image: hfmartinez/object_detection:reports
platform: linux/amd64
build:
context: ./microservices/reports
dockerfile: ./Dockerfile
command: bash -c "uvicorn microservices.reports.app:app --port=7000 --host=0.0.0.0"
depends_on:
db:
condition: service_healthy
env_file:
- ./microservices/reports/.env.dev
networks:
vpcbr:
ipv4_address: 10.5.0.12
client:
container_name: object-detection-client
hostname: object-detection-client
image: hfmartinez/object_detection:client
platform: linux/amd64
profiles: [dev, frontend]
pull_policy: always
build:
context: ./client/
ports:
- "127.0.0.1:8080:80"
networks:
vpcbr:
ipv4_address: 10.5.0.13
db-migration:
container_name: db_migration
hostname: db-migration
profiles: [migration]
pull_policy: always
restart: no
image: hfmartinez/object_detection:migration
platform: linux/amd64
build:
context: ./alembic
dockerfile: ./Dockerfile
command: bash -c "alembic upgrade head"
depends_on:
db:
condition: service_healthy
env_file:
- ./alembic/.env.dev
networks:
vpcbr:
ipv4_address: 10.5.0.14
db:
image: postgres:14.0
restart: always
hostname: object_detection_db
profiles: [dev, db, migration]
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_PASSWORD: admin
POSTGRES_USER: admin
POSTGRES_DB: object-detection
volumes:
- ./postgres-data:/var/lib/postgresql/data
networks:
vpcbr:
ipv4_address: 10.5.0.5
db-test:
image: postgres:14.0
profiles: [test]
environment:
POSTGRES_PASSWORD: admin
POSTGRES_USER: admin
POSTGRES_DB: object-detection-test
networks:
vpcbr:
ipv4_address: 10.5.0.6
redis-cache:
image: redis:alpine
profiles: [dev, db]
hostname: redis-cache
container_name: redis-cache
restart: on-failure
command: redis-server
volumes:
- cache:/data
networks:
vpcbr:
ipv4_address: 10.5.0.7
volumes:
cache:
driver: local
postgres-data:
networks:
vpcbr:
driver: bridge
ipam:
config:
- subnet: 10.5.0.0/16
gateway: 10.5.0.1