Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docker-compose-prod/docker-compose.gateway.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ services:
image: gateway:1.0.0
environment:
INTERNAL_SECRET: super-secret-key-123
MS_MEETING_URI: http://ms-meeting:8080
MS_VOTING_URI: http://ms-voting:8080
MS_MEETING_URI: lb://ms-meeting
MS_VOTING_URI: lb://ms-voting
MS_HOUSING_URI: http://ms-housing:8080
MS_INVITATION_URI: http://ms-invitation:8080
MS_REPORT_URI: http://ms-report:8080
MS_NOTIFICATION_URI: http://ms-notification:8080
MS_INVITATION_URI: lb://ms-invitation
MS_REPORT_URI: lb://ms-report
MS_NOTIFICATION_URI: lb://ms-notification
JWT_SECRET: ThisIssfnsdkjfksjfksdjfksdjfsdbjfadfjsjdfhgsjashkfjhsjfhjsdhvfdjvksdfhsjkd

CONSUL_HOST: consul
CONSUL_PORT: 8500

SPRING_PROFILES_ACTIVE: dev
SPRING_PROFILES_ACTIVE: prod
ports:
- "9000:8080"
depends_on:
Expand Down
7 changes: 3 additions & 4 deletions docker-compose-prod/docker-compose.housing.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
ms-housing:
container_name: ms-housing-prod
#container_name: ms-housing-prod
restart: always
build:
dockerfile: Dockerfile
Expand Down Expand Up @@ -28,6 +28,7 @@ services:
depends_on:
- db-housing
- rabbitmq
- consul
expose:
- "8080"

Expand All @@ -39,6 +40,4 @@ services:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: housing
MYSQL_USER: test
MYSQL_PASSWORD: test
ports:
- "3308:3306"
MYSQL_PASSWORD: test
4 changes: 2 additions & 2 deletions docker-compose-prod/docker-compose.invitation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ services:
GATEWAY_URL: http://gateway:8080

SPRING_PROFILES_ACTIVE: prod
ports:
- "8083:8080"
expose:
- "8080"
depends_on:
- db-invitation
- rabbitmq
Expand Down
8 changes: 3 additions & 5 deletions docker-compose-prod/docker-compose.meeting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
- consul
- rabbitmq
- db-meeting
ports:
- "8087:8080"
expose:
- "8080"
db-meeting:
container_name: db-meeting-prod
image: mysql:8.0
Expand All @@ -40,6 +40,4 @@ services:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: meeting
MYSQL_USER: test
MYSQL_PASSWORD: test
ports:
- "3311:3306"
MYSQL_PASSWORD: test
6 changes: 2 additions & 4 deletions docker-compose-prod/docker-compose.notification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ services:
CONSUL_PORT: 8500

SPRING_PROFILES_ACTIVE: prod
ports:
- "8095:8080"
expose:
- "8080"
depends_on:
- db-notification
- rabbitmq
Expand All @@ -40,5 +40,3 @@ services:
MYSQL_DATABASE: notification
MYSQL_USER: test
MYSQL_PASSWORD: test
ports:
- "3307:3306"
6 changes: 2 additions & 4 deletions docker-compose-prod/docker-compose.report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ services:
depends_on:
- rabbitmq
- db-report
ports:
- "8084:8080"
expose:
- "8080"
db-report:
container_name: db-report-prod
image: mysql:8.0
Expand All @@ -41,5 +41,3 @@ services:
MYSQL_DATABASE: report
MYSQL_USER: test
MYSQL_PASSWORD: test
ports:
- "3310:3306"
10 changes: 5 additions & 5 deletions docker-compose-prod/docker-compose.voting.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
ms-voting:
container_name: ms-voting-prod
#container_name: ms-voting-prod
restart: always
build:
dockerfile: Dockerfile
Expand Down Expand Up @@ -33,8 +33,10 @@ services:
- rabbitmq
- consul
- db-voting
ports:
- "8080:8080"
deploy:
replicas: 2
expose:
- "8080"
db-voting:
container_name: db-voting-prod
image: mysql:8.0
Expand All @@ -44,5 +46,3 @@ services:
MYSQL_DATABASE: voting
MYSQL_USER: test
MYSQL_PASSWORD: test
ports:
- "3306:3306"
4 changes: 4 additions & 0 deletions gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,10 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-loadbalancer</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway-server-webflux</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package com.micro.gateway.clientHousing;

import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.reactive.function.client.WebClient;

@Configuration
public class WebClientConfig {
@Bean
@LoadBalanced
public WebClient.Builder loadBalancedWebClientBuilder() {
return WebClient.builder();
}
}
15 changes: 15 additions & 0 deletions gateway/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@ spring:
consul:
host: ${CONSUL_HOST}
port: ${CONSUL_PORT}
discovery:
enabled: true
register: true
service-name: ${spring.application.name}
health-check-interval: 10s
instance-id: ${spring.application.name}:${random.value}
prefer-agent-address: false
prefer-ip-address: false
query-passing: true


gateway:
server:
Expand Down Expand Up @@ -53,6 +63,11 @@ spring:
- "PUT"
- "OPTIONS"
allowCredentials: true
discovery:
locator:
lower-case-service-id: true
enabled: true

management:
endpoint:
health:
Expand Down
9 changes: 9 additions & 0 deletions housing_association/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@ spring:
consul:
host: ${CONSUL_HOST}
port: ${CONSUL_PORT}
discovery:
enabled: true
register: true
service-name: ${spring.application.name}
instance-id: ${spring.application.name}-${random.value}
health-check-path: /actuator/health
health-check-interval: 10s
hostname: ${HOSTNAME:localhost}
prefer-ip-address: true

amqp:
exchanges:
Expand Down
10 changes: 10 additions & 0 deletions voting/src/main/resources/application-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ spring:
consul:
host: ${CONSUL_HOST}
port: ${CONSUL_PORT}
discovery:
enabled: true
register: true
service-name: ${spring.application.name}
instance-id: ${spring.application.name}-${random.value}
health-check-path: /actuator/health
health-check-interval: 10s
hostname: ${HOSTNAME:localhost}
prefer-ip-address: true

amqp:
queues:
Expand Down Expand Up @@ -54,3 +63,4 @@ management:
endpoint:
health:
show-components: always
show-details: always