refactor: Update frontend and backend URLs for Docker environment
This commit is contained in:
@@ -5,8 +5,6 @@ services:
|
||||
image: franklioxygen/mytube:backend-latest
|
||||
pull_policy: always
|
||||
container_name: mytube-backend
|
||||
ports:
|
||||
- "5551:5551"
|
||||
volumes:
|
||||
- /share/CACHEDEV2_DATA/Medias/MyTube/uploads:/app/uploads
|
||||
- /share/CACHEDEV2_DATA/Medias/MyTube/data:/app/data
|
||||
@@ -25,8 +23,8 @@ services:
|
||||
environment:
|
||||
# For internal container communication, use the service name
|
||||
# These will be replaced at runtime by the entrypoint script
|
||||
- VITE_API_URL=http://backend:5551/api
|
||||
- VITE_BACKEND_URL=http://backend:5551
|
||||
- VITE_API_URL=/api
|
||||
- VITE_BACKEND_URL=
|
||||
# For QNAP or other environments where service discovery doesn't work,
|
||||
# you can override these values using a .env file with:
|
||||
# - API_HOST=your-ip-or-hostname
|
||||
|
||||
@@ -6,8 +6,8 @@ DEFAULT_API_URL="http://localhost:5551/api"
|
||||
DEFAULT_BACKEND_URL="http://localhost:5551"
|
||||
|
||||
# Runtime values from docker-compose environment variables
|
||||
DOCKER_API_URL="${VITE_API_URL:-http://backend:5551/api}"
|
||||
DOCKER_BACKEND_URL="${VITE_BACKEND_URL:-http://backend:5551}"
|
||||
DOCKER_API_URL="${VITE_API_URL-http://backend:5551/api}"
|
||||
DOCKER_BACKEND_URL="${VITE_BACKEND_URL-http://backend:5551}"
|
||||
|
||||
# If API_HOST is provided, override with custom host configuration
|
||||
if [ ! -z "$API_HOST" ]; then
|
||||
|
||||
@@ -6,6 +6,30 @@ server {
|
||||
index index.html index.htm;
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location /api {
|
||||
proxy_pass http://backend:5551/api;
|
||||
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;
|
||||
}
|
||||
|
||||
location ^~ /videos {
|
||||
proxy_pass http://backend:5551/videos;
|
||||
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;
|
||||
}
|
||||
|
||||
location ^~ /images {
|
||||
proxy_pass http://backend:5551/images;
|
||||
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;
|
||||
}
|
||||
|
||||
# Cache static assets
|
||||
location ~* \.(jpg|jpeg|png|gif|ico|css|js)$ {
|
||||
|
||||
Reference in New Issue
Block a user