Skip to content

Commit cd73628

Browse files
authored
Merge pull request #88 from Particular/john/port
2 parents 0ddf3ad + eaf881c commit cd73628

File tree

7 files changed

+30
-20
lines changed

7 files changed

+30
-20
lines changed

src/docker-compose-base.yml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,28 +39,28 @@ services:
3939
ports:
4040
- 9090:9090
4141
environment:
42-
SERVICECONTROL_URL: http://servicecontrol:33333/api/
42+
SERVICECONTROL_URL: http://localhost:33333/api/
4343
ENABLE_REVERSE_PROXY: false
4444
SHOW_PENDING_RETRY: false
4545
frontend:
4646
container_name: frontend
4747
build:
4848
context: ./frontend # Path to the folder containing Dockerfile
4949
dockerfile: Dockerfile
50+
args:
51+
BILLING_SIGNALR: localhost:5002
52+
CLIENT_SIGNALR: localhost:5004
53+
SALES_SIGNALR: localhost:5001
54+
SHIPPING_SIGNALR: localhost:5003
5055
ports:
51-
- "61335:80"
56+
- 61335:80
5257
depends_on:
5358
- billing
5459
- shipping
5560
- clientui
5661
- sales
5762
volumes:
5863
- ./frontend:/app # Optional for hot reloading
59-
environment:
60-
- BILLING_SIGNALR=billing:5002
61-
- CLIENT_SIGNALR=clientui:5000
62-
- SALES_SIGNALR=sales:5001
63-
- SHIPPING_SIGNALR=shipping:5003
6464
billing:
6565
build:
6666
context: ./
@@ -73,6 +73,8 @@ services:
7373
- ORIGIN_URL=http://frontend:8080
7474
- TRANSPORT_TYPE
7575
- CONNECTION_STRING
76+
depends_on:
77+
- service-control
7678
shipping:
7779
build:
7880
context: ./
@@ -85,6 +87,8 @@ services:
8587
- ORIGIN_URL=http://frontend:8080
8688
- TRANSPORT_TYPE
8789
- CONNECTION_STRING
90+
depends_on:
91+
- service-control
8892
sales:
8993
build:
9094
context: ./
@@ -97,18 +101,22 @@ services:
97101
- ORIGIN_URL=http://frontend:8080
98102
- TRANSPORT_TYPE
99103
- CONNECTION_STRING
104+
depends_on:
105+
- service-control
100106
clientui:
101107
build:
102108
context: ./
103109
dockerfile: ./ClientUI/Dockerfile
104110
container_name: clientui
105111
ports:
106-
- "5000:80"
112+
- "5004:80"
107113
environment:
108114
- LISTENING_PORT=80
109115
- ORIGIN_URL=http://frontend:8080
110116
- TRANSPORT_TYPE
111117
- CONNECTION_STRING
118+
depends_on:
119+
- service-control
112120

113121
volumes:
114122
sc-data:

src/frontend/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ RUN npm install
1313
# Copy the rest of the application code
1414
COPY . .
1515

16+
ARG BILLING_SIGNALR
17+
ARG CLIENT_SIGNALR
18+
ARG SALES_SIGNALR
19+
ARG SHIPPING_SIGNALR
20+
21+
ENV VITE_CLIENT_SIGNALR=$CLIENT_SIGNALR
22+
ENV VITE_BILLING_SIGNALR=$BILLING_SIGNALR
23+
ENV VITE_SALES_SIGNALR=$SALES_SIGNALR
24+
ENV VITE_SHIPPING_SIGNALR=$SHIPPING_SIGNALR
25+
1626
# Build the application
1727
RUN npm run build
1828

src/frontend/src/components/BillingEndpoint.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import { store } from "./shared";
1414
import MessageContainer from "./MessageContainer.vue";
1515
import { GA4 } from "../utils/analytics";
1616
17-
const {connection, state} = useSignalR(`http://${import.meta.env.BILLING_SIGNALR ?? "localhost:5002"}/billingHub`);
17+
const {connection, state} = useSignalR(`http://${import.meta.env.VITE_BILLING_SIGNALR ?? "localhost:5002"}/billingHub`);
1818
1919
const processedCount = ref(0);
2020
const erroredCount = ref(0);

src/frontend/src/components/ClientEndpoint.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { store } from "./shared";
77
import type { PlaceOrder, Message } from "./types";
88
import MessageContainer from "./MessageContainer.vue";
99
10-
const { connection, state } = useSignalR(`http://${import.meta.env.CLIENT_SIGNALR ?? "localhost:5000"}/clientHub`);
10+
const { connection, state } = useSignalR(`http://${import.meta.env.VITE_CLIENT_SIGNALR ?? "localhost:5000"}/clientHub`);
1111
1212
const orderCount = ref(0);
1313
const messages = ref<Message[]>([]);

src/frontend/src/components/SalesEndpoint.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import MessageContainer from "./MessageContainer.vue";
1414
import { store } from "./shared";
1515
import { GA4 } from "../utils/analytics";
1616
17-
const { connection, state } = useSignalR(`http://${import.meta.env.SALES_SIGNALR ?? "localhost:5001"}/salesHub`);
17+
const { connection, state } = useSignalR(`http://${import.meta.env.VITE_SALES_SIGNALR ?? "localhost:5001"}/salesHub`);
1818
1919
const processedCount = ref(0);
2020
const erroredCount = ref(0);

src/frontend/src/components/ShippingEndpoint.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import MessageContainer from "./MessageContainer.vue";
1414
import { store } from "./shared";
1515
import { GA4 } from "../utils/analytics";
1616
17-
const { connection, state } = useSignalR(`http://${import.meta.env.SHIPPING_SIGNALR ?? "localhost:5003"}/shippingHub`);
17+
const { connection, state } = useSignalR(`http://${import.meta.env.VITE_SHIPPING_SIGNALR ?? "localhost:5003"}/shippingHub`);
1818
1919
const processedOrderPlacedCount = ref(0);
2020
const processedOrderBilledCount = ref(0);

src/frontend/vite.config.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,10 @@ import plugin from '@vitejs/plugin-vue';
33

44
// https://vitejs.dev/config/
55
export default defineConfig(() => {
6-
7-
86
return {
97
plugins: [plugin()],
108
server: {
119
port: process.env.PORT ? parseInt(process.env.PORT) : 61335,
12-
},
13-
define: {
14-
BILLING_SIGNALR: process.env.BILLING_SIGNALR,
15-
CLIENT_SIGNALR: process.env.CLIENT_SIGNALR,
16-
SALES_SIGNALR: process.env.SALES_SIGNALR,
17-
SHIPPING_SIGNALR: process.env.SHIPPING_SIGNALR,
1810
}
1911
}
2012
}

0 commit comments

Comments
 (0)