- Add Next.js API rewrites to proxy /api and /uploads requests - Update docker-compose.staging.yml to use relative API paths - Set NEXT_PUBLIC_API_URL to empty for staging (use rewrites) - Add BACKEND_URL env var for Next.js server-side proxying - Update all files to use relative paths when API_URL is empty This fixes the issue where the staging site (HTTPS) was trying to load resources from HTTP backend, causing Mixed Content errors. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
879 B
YAML
39 lines
879 B
YAML
services:
|
|
frontend-staging:
|
|
build:
|
|
context: ./frontend
|
|
dockerfile: Dockerfile
|
|
args:
|
|
- NEXT_PUBLIC_API_URL=
|
|
container_name: autonet-frontend-staging
|
|
ports:
|
|
- "3001:3000"
|
|
environment:
|
|
- NODE_ENV=staging
|
|
- BACKEND_URL=http://backend-staging:8000
|
|
depends_on:
|
|
- backend-staging
|
|
restart: unless-stopped
|
|
networks:
|
|
- autonet-staging
|
|
|
|
backend-staging:
|
|
build:
|
|
context: ./backend
|
|
dockerfile: Dockerfile
|
|
container_name: autonet-backend-staging
|
|
ports:
|
|
- "8001:8000"
|
|
environment:
|
|
- ENV=staging
|
|
volumes:
|
|
- /opt/autonet/production/backend/uploads:/app/uploads
|
|
- /opt/autonet/production/backend/autonet.db:/app/autonet.db
|
|
restart: unless-stopped
|
|
networks:
|
|
- autonet-staging
|
|
|
|
networks:
|
|
autonet-staging:
|
|
name: autonet-staging-network
|