Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ ARCHON_AGENTS_PORT=8052
ARCHON_UI_PORT=3737
ARCHON_DOCS_PORT=3838

# Frontend Configuration
# VITE_ALLOWED_HOSTS: Comma-separated list of additional hosts allowed for Vite dev server
# Example: VITE_ALLOWED_HOSTS=192.168.1.100,myhost.local,example.com
# If not set, defaults to localhost, 127.0.0.1, ::1, and the HOST value above
VITE_ALLOWED_HOSTS=

# When enabled, PROD mode will proxy ARCHON_SERVER_PORT through ARCHON_UI_PORT. This exposes both the
# Archon UI and API through a single port. This is useful when deploying Archon behind a reverse
# proxy where you want to expose the frontend on a single external domain.
Expand Down
11 changes: 10 additions & 1 deletion archon-ui-main/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,16 @@ export default defineConfig(({ mode }: ConfigEnv): UserConfig => {
host: '0.0.0.0', // Listen on all network interfaces with explicit IP
port: parseInt(process.env.ARCHON_UI_PORT || env.ARCHON_UI_PORT || '3737'), // Use configurable port
strictPort: true, // Exit if port is in use
allowedHosts: [env.HOST, 'localhost', '127.0.0.1'],
allowedHosts: (() => {
const defaultHosts = ['localhost', '127.0.0.1', '::1'];
const customHosts = env.VITE_ALLOWED_HOSTS?.trim()
? env.VITE_ALLOWED_HOSTS.split(',').map(h => h.trim()).filter(Boolean)
: [];
const hostFromEnv = (process.env.HOST ?? env.HOST) && (process.env.HOST ?? env.HOST) !== 'localhost'
? [process.env.HOST ?? env.HOST]
: [];
return [...new Set([...defaultHosts, ...hostFromEnv, ...customHosts])];
})(),
proxy: {
'/api': {
target: `http://${host}:${port}`,
Expand Down
9 changes: 7 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ services:
networks:
- app-network
depends_on:
- archon-server
archon-server:
condition: service_healthy

extra_hosts:
- "host.docker.internal:host-gateway"
healthcheck:
Expand Down Expand Up @@ -126,6 +128,7 @@ services:
- SERVICE_DISCOVERY_MODE=docker_compose
- LOG_LEVEL=${LOG_LEVEL:-INFO}
- ARCHON_AGENTS_PORT=${ARCHON_AGENTS_PORT:-8052}
- ARCHON_SERVER_PORT=${ARCHON_SERVER_PORT:-8181}
networks:
- app-network
healthcheck:
Expand Down Expand Up @@ -153,6 +156,7 @@ services:
- ARCHON_SERVER_PORT=${ARCHON_SERVER_PORT:-8181}
- HOST=${HOST:-localhost}
- PROD=${PROD:-false}
- VITE_ALLOWED_HOSTS=${VITE_ALLOWED_HOSTS:-}
Comment thread
UranymusDev marked this conversation as resolved.
networks:
- app-network
healthcheck:
Expand All @@ -164,7 +168,8 @@ services:
- ./archon-ui-main/src:/app/src
- ./archon-ui-main/public:/app/public
depends_on:
- archon-server
archon-server:
condition: service_healthy

networks:
app-network:
Expand Down