added replicas for docker swarm

This commit is contained in:
PxlLoewe
2025-05-27 21:40:18 -07:00
parent 2209372303
commit 23dd9c2958
4 changed files with 13 additions and 14 deletions

View File

@@ -7,18 +7,18 @@ AUTH_HUB_SECRET=var
AUTH_DISPATCH_COOKIE_PREFIX=DISPATCH
AUTH_HUB_COOKIE_PREFIX=HUB
AUTH_DISPATCH_URL=http://localhost:3001
AUTH_HUB_URL=http://localhost:3000
AUTH_DISPATCH_URL=http://premiumag.de:3001
AUTH_HUB_URL=http://premiumag.de:3000
NEXT_PUBLIC_DISPATCH_SERVICE_ID=1
# ───────────────────────────────────────────────
# 🌐 Öffentliche URLs
# ───────────────────────────────────────────────
NEXT_PUBLIC_HUB_URL=http://localhost:3000
NEXT_PUBLIC_HUB_SERVER_URL=http://localhost:3003
NEXT_PUBLIC_DISPATCH_URL=http://localhost:3001
NEXT_PUBLIC_DISPATCH_SERVER_URL=http://localhost:3002
NEXT_PUBLIC_HUB_URL=http://premiumag.de:3000
NEXT_PUBLIC_HUB_SERVER_URL=http://premiumag.de:3003
NEXT_PUBLIC_DISPATCH_URL=http://premiumag.de:3001
NEXT_PUBLIC_DISPATCH_SERVER_URL=http://premiumag.de:3002
# ───────────────────────────────────────────────
# 🗄️ Datenbank
@@ -50,10 +50,10 @@ HUB_URL=
# ───────────────────────────────────────────────
# 📚 Moodle
# ───────────────────────────────────────────────
MOODLE_URL=http://localhost:8081
MOODLE_URL=http://premiumag.de:8081
MOODLE_API_TOKEN=ac346f0324647b68488d13fd52a9bbe8
MOODLE_USER_PASSWORD=var-api-user-P1
NEXT_PUBLIC_MOODLE_URL=http://localhost:8081
NEXT_PUBLIC_MOODLE_URL=http://premiumag.de:8081
# ───────────────────────────────────────────────
# 📧 E-Mail Einstellungen (nur HUB Server)

View File

@@ -40,7 +40,6 @@ export const handleSendMessage =
const recvSockets = await io.in(`user:${userId}`).fetchSockets();
await io.in(`user:${senderId}`).fetchSockets();
console.log(`Sockets in room user:${userId}:`);
if (!recvSockets.length) {
cb({ error: "User is not connected" });
} else {

View File

@@ -6,7 +6,6 @@ export async function GET(req: NextRequest): Promise<NextResponse> {
const id = searchParams.get("id");
const filter = searchParams.get("filter");
console.log(filter);
const filterParsed = JSON.parse(filter || "{}");
try {
@@ -20,9 +19,6 @@ export async function GET(req: NextRequest): Promise<NextResponse> {
return NextResponse.json(data, { status: 200 });
} catch (error) {
console.error(error);
return NextResponse.json(
{ error: "Failed to fetch mission" },
{ status: 500 },
);
return NextResponse.json({ error: "Failed to fetch mission" }, { status: 500 });
}
}

View File

@@ -1,5 +1,7 @@
services:
dispatch:
deploy:
replicas: 3
build:
context: .
dockerfile: ./apps/dispatch/Dockerfile
@@ -47,6 +49,8 @@ services:
postgres:
condition: service_healthy
dispatch-server:
deploy:
replicas: 3
build:
context: .
dockerfile: ./apps/dispatch-server/Dockerfile