feat: dockerfiles and full docker-compose orchestration
Add multi-stage Dockerfiles for Python services (Dockerfile.service) and React dashboard (Dockerfile.dashboard + nginx.conf). Update docker-compose.yml with all seven application services: news-fetcher, sentiment-analyzer, signal-generator, trade-executor, learning-engine, api-gateway, and dashboard.
This commit is contained in:
parent
e470055354
commit
b255b3edbe
4 changed files with 250 additions and 0 deletions
63
docker/nginx.conf
Normal file
63
docker/nginx.conf
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
# nginx configuration for the trading-bot dashboard.
|
||||
# Serves the React SPA and proxies API / WebSocket requests to the api-gateway.
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# SPA: serve index.html for any path not matching a static file
|
||||
# ---------------------------------------------------------------------------
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Proxy /api/* to the api-gateway service
|
||||
# ---------------------------------------------------------------------------
|
||||
location /api/ {
|
||||
proxy_pass http://api-gateway:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Proxy /auth/* to the api-gateway service
|
||||
# ---------------------------------------------------------------------------
|
||||
location /auth/ {
|
||||
proxy_pass http://api-gateway:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# Proxy /health to the api-gateway service
|
||||
# ---------------------------------------------------------------------------
|
||||
location /health {
|
||||
proxy_pass http://api-gateway:8000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
}
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
# WebSocket upgrade for /ws
|
||||
# ---------------------------------------------------------------------------
|
||||
location /ws {
|
||||
proxy_pass http://api-gateway:8000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
proxy_read_timeout 86400;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue