chore(deployment): add docker-compose and nginx setup for production
- Added Dockerfile and nginx.conf for frontend production build. - Added docker-compose.yml to orchestrate backend and frontend. - Updated geminiService.ts to support relative API paths via Nginx proxy. - Updated documentation with deployment instructions for Synology/Docker.
This commit is contained in:
22
general-market-intelligence/nginx.conf
Normal file
22
general-market-intelligence/nginx.conf
Normal file
@@ -0,0 +1,22 @@
|
||||
server {
|
||||
listen 80;
|
||||
|
||||
# 1. Serve React Frontend (Static Files)
|
||||
location / {
|
||||
root /usr/share/nginx/html;
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html; # Support for React Router (SPA)
|
||||
}
|
||||
|
||||
# 2. Proxy API Requests to Backend Container
|
||||
location /api/ {
|
||||
# 'backend' is the service name in docker-compose.yml
|
||||
# Port 3001 is where the Node.js bridge listens
|
||||
proxy_pass http://backend:3001/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user