Fix jwt-token
This commit is contained in:
@@ -40,5 +40,10 @@ SMTP_PASSWORD=
|
||||
SMTP_FROM=
|
||||
|
||||
# Frontend Configuration
|
||||
VITE_API_URL=http://localhost:3002/api
|
||||
VITE_WS_URL=ws://localhost:3002
|
||||
VITE_BASE_PATH=/uggla/
|
||||
VITE_API_URL=
|
||||
|
||||
# Debug Configuration
|
||||
STORE_HEARTBEATS=false
|
||||
STORE_DRONE_TYPE0=false
|
||||
LOG_ALL_DETECTIONS=false
|
||||
|
||||
@@ -17,13 +17,13 @@ RUN npm install --production=false
|
||||
COPY . .
|
||||
|
||||
# Build arguments for environment variables
|
||||
ARG VITE_API_URL=http://localhost:3001/api
|
||||
ARG VITE_WS_URL=ws://localhost:3001
|
||||
ARG VITE_BASE_PATH=/uggla/
|
||||
ARG VITE_API_URL
|
||||
ARG NODE_ENV=production
|
||||
|
||||
# Set environment variables for build
|
||||
ENV VITE_BASE_PATH=$VITE_BASE_PATH
|
||||
ENV VITE_API_URL=$VITE_API_URL
|
||||
ENV VITE_WS_URL=$VITE_WS_URL
|
||||
ENV NODE_ENV=$NODE_ENV
|
||||
|
||||
# Build the application
|
||||
|
||||
@@ -65,6 +65,9 @@ services:
|
||||
TWILIO_PHONE_NUMBER: ${TWILIO_PHONE_NUMBER}
|
||||
CORS_ORIGIN: http://localhost:3001
|
||||
API_DEBUG: ${API_DEBUG:-false}
|
||||
STORE_HEARTBEATS: ${STORE_HEARTBEATS:-false}
|
||||
STORE_DRONE_TYPE0: ${STORE_DRONE_TYPE0:-false}
|
||||
LOG_ALL_DETECTIONS: ${LOG_ALL_DETECTIONS:-false}
|
||||
ports:
|
||||
- "3002:3001"
|
||||
volumes:
|
||||
@@ -89,8 +92,8 @@ services:
|
||||
context: ./client
|
||||
dockerfile: Dockerfile
|
||||
args:
|
||||
VITE_API_URL: ${VITE_API_URL:-/drones/api}
|
||||
VITE_WS_URL: ${VITE_WS_URL:-/drones}
|
||||
VITE_BASE_PATH: ${VITE_BASE_PATH:-/uggla/}
|
||||
VITE_API_URL: ${VITE_API_URL}
|
||||
NODE_ENV: production
|
||||
container_name: drone-detection-frontend
|
||||
restart: unless-stopped
|
||||
|
||||
@@ -25,9 +25,10 @@ server {
|
||||
application/xml+rss
|
||||
application/json;
|
||||
|
||||
# Handle React Router (SPA)
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
# Handle React Router (SPA) - serve from /uggla/ path
|
||||
location /uggla/ {
|
||||
alias /usr/share/nginx/html/;
|
||||
try_files $uri $uri/ /uggla/index.html;
|
||||
|
||||
# Cache static assets
|
||||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ {
|
||||
@@ -36,9 +37,14 @@ server {
|
||||
}
|
||||
}
|
||||
|
||||
# Root redirect to uggla
|
||||
location = / {
|
||||
return 301 /uggla/;
|
||||
}
|
||||
|
||||
# Proxy API requests to backend
|
||||
location /api {
|
||||
proxy_pass http://backend:3001;
|
||||
location /uggla/api/ {
|
||||
proxy_pass http://backend:3001/api/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
@@ -51,8 +57,8 @@ server {
|
||||
}
|
||||
|
||||
# WebSocket proxy for Socket.IO
|
||||
location /socket.io/ {
|
||||
proxy_pass http://backend:3001;
|
||||
location /uggla/socket.io/ {
|
||||
proxy_pass http://backend:3001/socket.io/;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
||||
Reference in New Issue
Block a user