Skip to content

Commit c2fa372

Browse files
authored
Merge pull request #6 from jhd3197/dev
Make server port configurable via PORT environment variable
2 parents 92576db + efb06e2 commit c2fa372

2 files changed

Lines changed: 6 additions & 5 deletions

File tree

Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ RUN cd frontend && npm install
1919
COPY frontend/ frontend/
2020
RUN cd frontend && npm run build
2121

22-
EXPOSE 6391
22+
EXPOSE ${PORT:-6391}
2323

24-
CMD ["agentsite", "serve", "--host", "0.0.0.0", "--port", "6391"]
24+
CMD ["sh", "-c", "agentsite serve --host 0.0.0.0 --port ${PORT:-6391}"]

agentsite/config.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import os
56
from pathlib import Path
67

78
from pydantic_settings import BaseSettings
@@ -18,9 +19,9 @@ class Settings(BaseSettings):
1819
# Data directory for projects and database
1920
data_dir: Path = Path.home() / ".agentsite"
2021

21-
# Server
22-
host: str = "127.0.0.1"
23-
port: int = 6391
22+
# Server — also respect the plain PORT env var (used by Railway, Render, etc.)
23+
host: str = "0.0.0.0"
24+
port: int = int(os.environ.get("PORT", 6391))
2425

2526
# Agent pipeline
2627
max_review_iterations: int = 2

0 commit comments

Comments
 (0)