-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
157 lines (147 loc) · 5.18 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
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
154
155
156
157
version: '3.4'
services:
apigateway:
image: traefik:v2.2
container_name: "apigateway"
command:
- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
ports:
- "80:80"
- "8080:8080"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
series-and-episodes:
build:
context: .
dockerfile: SeriesAndEpisodes/Dockerfile
image: series-and-episodes:dev
environment:
SeriesDbSettings__SeriesCollectionName: "Series"
SeriesDbSettings__ConnectionString: "mongodb://root:rootpassword@mongodb-seriesdb:27017"
SeriesDbSettings__DatabaseName: "SeriesDb"
MessageQueueSettings__Hostname: "message-queue"
MessageQueueSettings__Username: "guest"
MessageQueueSettings__Password: "guest"
ports:
- "3001:80"
depends_on:
- mongodb-seriesdb
- message-queue
labels:
- "traefik.enable=true"
- "traefik.http.routers.series-and-episodes.rule=PathPrefix(`/api/public/Series`) || PathPrefix(`/api/public/Images`)"
- "traefik.http.routers.series-and-episodes.entrypoints=web"
- "traefik.http.routers.series-and-episodes-admin.rule=PathPrefix(`/api/admin/Series`) || PathPrefix(`/api/admin/Images`)"
- "traefik.http.routers.series-and-episodes-admin.entrypoints=web"
- "traefik.http.routers.series-and-episodes-admin.middlewares=user-service-admin"
mongodb-seriesdb:
image: mongo:4.2.3
container_name: "mongodb-seriesdb"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: rootpassword
ports:
- "27018:27017"
volumes:
- mongodb-data:/data/db
ratings:
build:
context: RatingsMicroservice
dockerfile: Dockerfile
image: ratings:dev
container_name: "ratings"
environment:
KTOR_ENV: prod
LOG_LEVEL: INFO
db__jdbcUrl: jdbc:mysql://mysql-ratingdb:3306/ratings
db__username: root
db__password: helloworld
message-queue__hostname: "message-queue"
message-queue__username: "guest"
message-queue__password: "guest"
ports:
- "3002:8080"
depends_on:
- mysql-ratingdb
- message-queue
labels:
- "traefik.enable=true"
- "traefik.http.routers.ratings.rule=PathPrefix(`/api/public/SeriesRatings`) || PathPrefix(`/api/public/EpisodeRatings`)"
- "traefik.http.routers.ratings.entrypoints=web"
- "traefik.http.routers.ratings-login.rule=PathPrefix(`/api/protected/SeriesRatings`) || PathPrefix(`/api/protected/EpisodeRatings`)"
- "traefik.http.routers.ratings-login.entrypoints=web"
- "traefik.http.routers.ratings-login.middlewares=user-service"
mysql-ratingdb:
image: mysql:8.0.22
container_name: "mysql-ratingdb"
environment:
MYSQL_ROOT_PASSWORD: helloworld
MYSQL_DATABASE: ratings
ports:
- "3307:3306"
volumes:
- mysql-data:/var/lib/mysql
webclient:
build:
context: webclient
dockerfile: Dockerfile
image: webclient:dev
container_name: "webclient"
ports:
- "5000:80"
labels:
- "traefik.enable=true"
- "traefik.http.routers.webclient.rule=PathPrefix(`/`)"
- "traefik.http.routers.webclient.entrypoints=web"
message-queue:
image: rabbitmq:3.8.3-management
container_name: "message-queue"
ports:
# The standard AMQP protocol port
- '5672:5672'
# HTTP management UI
- '15672:15672'
hostname: message-queue
user-service:
build:
context: .
dockerfile: UserServer/Dockerfile
image: user-service:dev
environment:
OpenIdConnectSettings__ClientId: "<ClientId>"
OpenIdConnectSettings__ClientSecret: "<ClientSecret>"
OpenIdConnectSettings__Authority: "https://accounts.google.com"
OpenIdConnectSettings__EndSessionEndpoint: "https://accounts.google.com/Logout"
OpenIdConnectSettings__SigninRedirectUrl: "http://localhost:80/signin-oidc"
TokenSettings__Issuer: "http://localhost:80"
TokenSettings__Audience: "http://localhost:80"
TokenSettings__Secret: "A_long_enough_secret_text_which_is_not_too_short_unless_there_will_be_an_error"
ConnectionStrings__DbConnection: "Server=user-db;Database=master;User=sa;Password=Your_password123;"
ports:
- "3003:80"
depends_on:
- user-db
labels:
- "traefik.enable=true"
- "traefik.http.routers.user-service.rule=PathPrefix(`/api/Account`) || PathPrefix(`/signin-oidc`)"
- "traefik.http.routers.user-service.entrypoints=web"
- "traefik.http.middlewares.user-service.forwardauth.address=http://user-service:80/api/Account/AuthenticateWithToken"
- "traefik.http.middlewares.user-service-admin.forwardauth.address=http://user-service:80/api/Account/AuthenticateAdminWithToken"
user-db:
image: "mcr.microsoft.com/mssql/server:2019-CU4-ubuntu-16.04"
container_name: user-db
environment:
SA_PASSWORD: "Your_password123"
ACCEPT_EULA: "Y"
ports:
- "1433:1433"
volumes:
- mssql-server-data:/var/opt/mssql
volumes:
mongodb-data:
mysql-data:
mssql-server-data: