feat: add production Traefik docker-compose, dynamic origin resolution, and next.config
This commit is contained in:
+40
-12
@@ -6,9 +6,7 @@ services:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
container_name: aura-quant-backend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "8085:8085"
|
||||
restart: always
|
||||
environment:
|
||||
- ENVIRONMENT=production
|
||||
- PORT=8085
|
||||
@@ -17,22 +15,37 @@ services:
|
||||
- MAX_DAILY_DRAWDOWN_PERCENT=2.5
|
||||
- MAX_SPREAD_PIPS=25.0
|
||||
- MIN_CONFLUENCE_SCORE=85
|
||||
- EXNESS_ACCOUNT_ID=${EXNESS_ACCOUNT_ID:-0}
|
||||
- EXNESS_ACCOUNT_ID=${EXNESS_ACCOUNT_ID:-425437997}
|
||||
- EXNESS_PASSWORD=${EXNESS_PASSWORD:-}
|
||||
- EXNESS_SERVER=${EXNESS_SERVER:-Exness-MT5Trial}
|
||||
- EXNESS_SERVER=${EXNESS_SERVER:-Exness-MT5Real15}
|
||||
- ADMIN_PIN=${ADMIN_PIN:-2671}
|
||||
- ADMIN_TOKEN=${ADMIN_TOKEN:-AuraTrade-Master-Secret-2671$}
|
||||
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN:-8622249634:AAFyJk4eaH3txNVIJ36m-48z8ib4mCUJjfg}
|
||||
- TELEGRAM_CHAT_ID=${TELEGRAM_CHAT_ID:-7107005438}
|
||||
networks:
|
||||
- aura-network
|
||||
- coolify
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.middlewares.gzip.compress=true"
|
||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
||||
- "traefik.http.routers.http-trade-be.entryPoints=http"
|
||||
- "traefik.http.routers.http-trade-be.rule=Host(`trade.auraajenticai.cloud`) && (PathPrefix(`/api`) || PathPrefix(`/ws`) || PathPrefix(`/docs`) || PathPrefix(`/openapi.json`))"
|
||||
- "traefik.http.routers.http-trade-be.priority=100"
|
||||
- "traefik.http.routers.http-trade-be.middlewares=redirect-to-https"
|
||||
- "traefik.http.routers.https-trade-be.entryPoints=https"
|
||||
- "traefik.http.routers.https-trade-be.rule=Host(`trade.auraajenticai.cloud`) && (PathPrefix(`/api`) || PathPrefix(`/ws`) || PathPrefix(`/docs`) || PathPrefix(`/openapi.json`))"
|
||||
- "traefik.http.routers.https-trade-be.priority=100"
|
||||
- "traefik.http.routers.https-trade-be.service=https-trade-be"
|
||||
- "traefik.http.routers.https-trade-be.tls=true"
|
||||
- "traefik.http.routers.https-trade-be.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.https-trade-be.loadbalancer.server.port=8085"
|
||||
|
||||
aura-quant-frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
dockerfile: Dockerfile
|
||||
container_name: aura-quant-frontend
|
||||
restart: unless-stopped
|
||||
ports:
|
||||
- "3000:3000"
|
||||
restart: always
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- NEXT_PUBLIC_API_URL=https://trade.auraajenticai.cloud
|
||||
@@ -40,8 +53,23 @@ services:
|
||||
depends_on:
|
||||
- aura-quant-backend
|
||||
networks:
|
||||
- aura-network
|
||||
- coolify
|
||||
labels:
|
||||
- "traefik.enable=true"
|
||||
- "traefik.http.middlewares.gzip.compress=true"
|
||||
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
|
||||
- "traefik.http.routers.http-trade-fe.entryPoints=http"
|
||||
- "traefik.http.routers.http-trade-fe.rule=Host(`trade.auraajenticai.cloud`)"
|
||||
- "traefik.http.routers.http-trade-fe.priority=10"
|
||||
- "traefik.http.routers.http-trade-fe.middlewares=redirect-to-https"
|
||||
- "traefik.http.routers.https-trade-fe.entryPoints=https"
|
||||
- "traefik.http.routers.https-trade-fe.rule=Host(`trade.auraajenticai.cloud`)"
|
||||
- "traefik.http.routers.https-trade-fe.priority=10"
|
||||
- "traefik.http.routers.https-trade-fe.service=https-trade-fe"
|
||||
- "traefik.http.routers.https-trade-fe.tls=true"
|
||||
- "traefik.http.routers.https-trade-fe.tls.certresolver=letsencrypt"
|
||||
- "traefik.http.services.https-trade-fe.loadbalancer.server.port=3000"
|
||||
|
||||
networks:
|
||||
aura-network:
|
||||
driver: bridge
|
||||
coolify:
|
||||
external: true
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
/** @type {import('next').NextConfig} */
|
||||
const nextConfig = {
|
||||
reactStrictMode: false,
|
||||
typescript: {
|
||||
ignoreBuildErrors: true,
|
||||
},
|
||||
eslint: {
|
||||
ignoreDuringBuilds: true,
|
||||
},
|
||||
};
|
||||
|
||||
export default nextConfig;
|
||||
@@ -17,7 +17,26 @@ import { soundFX } from "@/lib/soundEffects";
|
||||
export default function TitanQuantTerminalPage() {
|
||||
const [isUnlocked, setIsUnlocked] = useState(false);
|
||||
const [authToken, setAuthToken] = useState("");
|
||||
const [apiBaseUrl, setApiBaseUrl] = useState("http://localhost:8085");
|
||||
const [apiBaseUrl, setApiBaseUrl] = useState(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
if (window.location.hostname === "localhost" && window.location.port === "3000") {
|
||||
return "http://localhost:8085";
|
||||
}
|
||||
return window.location.origin;
|
||||
}
|
||||
return process.env.NEXT_PUBLIC_API_URL || "http://localhost:8085";
|
||||
});
|
||||
|
||||
const [wsUrl, setWsUrl] = useState(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
if (window.location.hostname === "localhost" && window.location.port === "3000") {
|
||||
return "ws://localhost:8085/ws/stream";
|
||||
}
|
||||
const proto = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
return `${proto}//${window.location.host}/ws/stream`;
|
||||
}
|
||||
return process.env.NEXT_PUBLIC_WS_URL || "ws://localhost:8085/ws/stream";
|
||||
});
|
||||
const [activeSymbol, setActiveSymbol] = useState("XAUUSD");
|
||||
const [activeTimeframe, setActiveTimeframe] = useState("15m");
|
||||
const [candles, setCandles] = useState<any[]>([]);
|
||||
@@ -31,10 +50,17 @@ export default function TitanQuantTerminalPage() {
|
||||
const [exnessServer, setExnessServer] = useState("Exness-MT5Real15");
|
||||
|
||||
// WebSocket Hook
|
||||
const { isConnected, packet, ping } = useExnessWebSocket("ws://localhost:8085/ws/stream");
|
||||
const { isConnected, packet, ping } = useExnessWebSocket(wsUrl);
|
||||
|
||||
// Check Existing Session & Auto-Lock on Inactivity
|
||||
useEffect(() => {
|
||||
if (typeof window !== "undefined") {
|
||||
if (window.location.hostname !== "localhost") {
|
||||
setApiBaseUrl(window.location.origin);
|
||||
const proto = window.location.protocol === "https:" ? "wss:" : "ws:";
|
||||
setWsUrl(`${proto}//${window.location.host}/ws/stream`);
|
||||
}
|
||||
}
|
||||
const saved = sessionStorage.getItem("aura_trade_token");
|
||||
if (saved) {
|
||||
setAuthToken(saved);
|
||||
|
||||
Reference in New Issue
Block a user