Skip to content

Commit c309542

Browse files
committed
address network/security
1 parent fb2fc1a commit c309542

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

dockerize/docker-compose.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ services:
8181
max-size: "100m"
8282
max-file: "5"
8383

84+
networks:
85+
- monai-network
86+
8487
# FastAPI Authentication & Gateway Service
8588
auth-gateway:
8689
build:

dockerize/secretai/server.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@
2929

3030
settings = Settings()
3131

32-
REST_API_HOST=os.getenv('REST_API_HOST')
33-
REST_API_PORT=int(os.getenv('REST_API_PORT'))
32+
REST_API_HOST=os.getenv('REST_API_HOST', '0.0.0.0')
33+
REST_API_PORT_STR=os.getenv('REST_API_PORT', '8090')
3434

35-
if not REST_API_HOST or not REST_API_PORT:
36-
print("REST_API_HOST and/or REST_API_PORT must be set in environment variables")
35+
try:
36+
REST_API_PORT = int(REST_API_PORT_STR)
37+
except (ValueError, TypeError):
38+
print("REST_API_PORT must be a valid integer")
39+
sys.exit(1)
40+
41+
if not REST_API_HOST:
42+
print("REST_API_HOST must be set in environment variables")
3743
sys.exit(1)
3844

3945

@@ -427,8 +433,6 @@ async def not_found_handler(request, exc):
427433
print("=" * 60)
428434
print("🔐 MONAI Authentication & Gateway Service")
429435
print("=" * 60)
430-
print(f"👤 Username: {settings.USERNAME}")
431-
print(f"🔑 Password: {settings.PASSWORD}")
432436
print(f"🌐 Server: http://{REST_API_HOST}:{REST_API_PORT}")
433437
print(f"🎯 TorchServe: {TORCHSERVE_URL}")
434438
print(f"📂 Tokens: /app/tokens/key_file.json")

0 commit comments

Comments
 (0)