-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
106 lines (98 loc) · 3.14 KB
/
docker-compose.yaml
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
services:
## Infrastructure
rabbitmq:
image: rabbitmq:4.0-management
volumes:
- rabbitmq-data:/var/lib/rabbitmq/mnesia/rabbit@my-rabbit
environment:
RABBITMQ_DEFAULT_USER: "${RABBITMQ_USER}"
RABBITMQ_DEFAULT_PASS: "${RABBITMQ_PASSWORD}"
RABBITMQ_DEFAULT_VHOST: "${RABBITMQ_VHOST}"
ports:
- 5672:5672
- 15672:15672
networks:
- cqrs-net
postgres:
image: postgres:16.6
volumes:
- postgres-data:/var/lib/postgresql
ports:
- "5432:5432"
environment:
POSTGRES_USER: "${POSTGRES_USER}"
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_DB: "${POSTGRES_DB}"
networks:
- cqrs-net
## Server
server-application:
build:
context: ./src/CQRS.Application.Host
dockerfile: cqrs-app.Dockerfile
environment:
CQRS_CqrsApp__ServiceUrl: "http://*:17321"
CQRS_CqrsApp__MartenDb__Endpoint__Host: "postgres"
CQRS_CqrsApp__MartenDb__Endpoint__Port: "5432"
CQRS_CqrsApp__MartenDb__Username: "${POSTGRES_USER}"
CQRS_CqrsApp__MartenDb__Password: "${POSTGRES_PASSWORD}"
CQRS_CqrsApp__MartenDb__Database: "${POSTGRES_DB}"
CQRS_CqrsApp__MassTransit__RabbitMq__Endpoint__Host: "rabbitmq"
CQRS_CqrsApp__MassTransit__RabbitMq__Endpoint__Port: "5672"
CQRS_CqrsApp__MassTransit__RabbitMq__Username: "${RABBITMQ_USER}"
CQRS_CqrsApp__MassTransit__RabbitMq__Password: "${RABBITMQ_PASSWORD}"
CQRS_CqrsApp__MassTransit__RabbitMq__VHost: "${RABBITMQ_VHOST}"
CQRS_CqrsApp__Logging__Level: "Information"
ports:
- "17321:17321"
depends_on:
- rabbitmq
- postgres
networks:
- cqrs-net
server-api:
build:
context: ./src/CQRS.API.Host
dockerfile: cqrs-api.Dockerfile
environment:
CQRS_CqrsApi__ServiceUrl: "http://*:17322"
CQRS_CqrsApi__MartenDb__Endpoint__Host: "postgres"
CQRS_CqrsApi__MartenDb__Endpoint__Port: "5432"
CQRS_CqrsApi__MartenDb__Username: "${POSTGRES_USER}"
CQRS_CqrsApi__MartenDb__Password: "${POSTGRES_PASSWORD}"
CQRS_CqrsApi__MartenDb__Database: "${POSTGRES_DB}"
CQRS_CqrsApi__MassTransit__RabbitMq__Endpoint__Host: "rabbitmq"
CQRS_CqrsApi__MassTransit__RabbitMq__Endpoint__Port: "5672"
CQRS_CqrsApi__MassTransit__RabbitMq__Username: "${RABBITMQ_USER}"
CQRS_CqrsApi__MassTransit__RabbitMq__Password: "${RABBITMQ_PASSWORD}"
CQRS_CqrsApi__MassTransit__RabbitMq__VHost: "${RABBITMQ_VHOST}"
CQRS_CqrsApi__Logging__Level: "Information"
ports:
- "17322:17322"
depends_on:
- rabbitmq
- postgres
- server-application
networks:
- cqrs-net
# ## Client
# # a.t.m cqrs-cli exits immediately after completing a command
# # so this would stop the whole Docker Compose project instance
# client:
# build:
# context: ./src/CQRS.CLI
# dockerfile: cqrs-client.Dockerfile
# environment:
# CQRS_CqrsCli__ApiServiceUrl: "http://server-api:17322"
# depends_on:
# - server-api
# networks:
# - cqrs-net
volumes:
rabbitmq-data:
driver: local
postgres-data:
driver: local
networks:
cqrs-net:
driver: bridge