Skip to content

Commit f5f26f5

Browse files
authored
Merge pull request #130 from AET-DevOps25/feature/unify-app-ports
Unify service ports
2 parents 1fe5acd + bea16b0 commit f5f26f5

File tree

10 files changed

+18
-20
lines changed

10 files changed

+18
-20
lines changed

client/nginx.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ server {
1616
}
1717

1818
location /api/ {
19-
proxy_pass http://apigw-service/;
19+
proxy_pass http://apigw-service:8080/;
2020
proxy_set_header Host $host;
2121
proxy_set_header X-Real-IP $remote_addr;
2222
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ services:
6666
volumes:
6767
- qdrant_storage:/qdrant/storage
6868

69-
mongodb:
69+
mongodb-service:
7070
image: mongo:8.0
7171
container_name: mongodb
7272
ports:
@@ -92,7 +92,7 @@ services:
9292
- ME_CONFIG_BASICAUTH_USERNAME=admin
9393
- ME_CONFIG_BASICAUTH_PASSWORD=admin
9494
depends_on:
95-
- mongodb
95+
- mongodb-service
9696
restart: unless-stopped
9797

9898
prometheus:

recipai-chart/templates/genai/genai-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
app: genai
88
ports:
99
- protocol: TCP
10-
port: 80
10+
port: 8000
1111
targetPort: genai-api

recipai-chart/templates/prometheus/prometheus-configmap.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,16 @@ data:
1515
- targets: ['node-exporter-prometheus-node-exporter:9100']
1616
- job_name: 'genai-service'
1717
static_configs:
18-
- targets: ['genai-service:80']
18+
- targets: ['genai-service:8000']
1919
- job_name: 'api-gw'
2020
metrics_path: '/actuator/prometheus'
2121
static_configs:
22-
- targets: ['apigw-service:80']
22+
- targets: ['apigw-service:8080']
2323
- job_name: 'chat'
2424
metrics_path: '/actuator/prometheus'
2525
static_configs:
26-
- targets: ['chat-service:80']
26+
- targets: ['chat-service:8082']
2727
- job_name: 'user'
2828
metrics_path: '/actuator/prometheus'
2929
static_configs:
30-
- targets: ['user-service:80']
30+
- targets: ['user-service:8081']

recipai-chart/templates/server/apigw-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
app: apigw
88
ports:
99
- protocol: TCP
10-
port: 80
10+
port: 8080
1111
targetPort: apigw-api

recipai-chart/templates/server/chat-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
app: chat
88
ports:
99
- protocol: TCP
10-
port: 80
10+
port: 8082
1111
targetPort: chat-api

recipai-chart/templates/server/user-service.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ spec:
77
app: user
88
ports:
99
- protocol: TCP
10-
port: 80
10+
port: 8081
1111
targetPort: user-api

server/api-gw/src/main/resources/application.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@ spring:
88
mvc:
99
routes:
1010
- id: genai
11-
uri: http://genai-service
11+
uri: http://genai-service:8000
1212
predicates:
1313
- Path=/genai/**
1414
- id: user
15-
uri: http://user-service
15+
uri: http://user-service:8081
1616
predicates:
1717
- Path=/user/**
1818
- id: chat
19-
uri: http://chat-service
19+
uri: http://chat-service:8082
2020
predicates:
2121
- Path=/chat/**
2222
security:

server/chat/src/main/java/com/continiousdisappointment/chat/service/GenAiService.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.springframework.stereotype.Service;
1414
import org.springframework.web.client.RestTemplate;
1515

16-
1716
import java.util.Arrays;
1817
import java.util.List;
1918

@@ -35,9 +34,8 @@ public String generateAssistantReply(String query, List<GenAiMessage> messages)
3534
ResponseEntity<GenAiResponse> response = restTemplate.postForEntity(
3635
getGenAiServiceUrl() + "/genai/generate",
3736
entity,
38-
GenAiResponse.class
39-
);
40-
log.info("GenAI service is called with reponse {} ", response.getBody().response());
37+
GenAiResponse.class);
38+
log.info("GenAI service is called with response {} ", response.getBody().response());
4139
return response.getBody().response();
4240

4341
} catch (Exception e) {
@@ -50,6 +48,6 @@ private String getGenAiServiceUrl() {
5048
if (Arrays.asList(environment.getActiveProfiles()).contains("dev")) {
5149
return "http://localhost:8000";
5250
}
53-
return "http://genai-service";
51+
return "http://genai-service:8000";
5452
}
5553
}

server/chat/src/main/java/com/continiousdisappointment/chat/service/UserService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ private String getUserServiceUrl() {
3636
if (Arrays.asList(environment.getActiveProfiles()).contains("dev")) {
3737
return "http://localhost:8081/user/info";
3838
}
39-
return "http://user-service/user/info";
39+
return "http://user-service:8081/user/info";
4040
}
4141
}

0 commit comments

Comments
 (0)