Change backend port to 8101 and simplify Caddy config
- Changed backend port from 8000 to 8101 (avoiding port conflict) - Added REPLICATE_API_KEY to docker-compose environment variables - Simplified Caddyfile - only need to reverse proxy frontend - Frontend nginx internally handles routing API calls to backend
This commit is contained in:
@@ -1,54 +1,15 @@
|
|||||||
# Caddy 2 Configuration for AI Photo Edit
|
# Caddy 2 Configuration for AI Photo Edit
|
||||||
|
# Simple version - frontend nginx handles API routing internally
|
||||||
|
|
||||||
# Replace with your actual domain
|
# Option 1: With domain name
|
||||||
ai-photo-edit.yourdomain.com {
|
ai-photo-edit.yourdomain.com {
|
||||||
# Frontend - serves the React app
|
|
||||||
reverse_proxy localhost:3080
|
reverse_proxy localhost:3080
|
||||||
|
|
||||||
# API routes - proxy to backend
|
|
||||||
handle /projects* {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
|
|
||||||
handle /edits* {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
|
|
||||||
handle /patches* {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
|
|
||||||
handle /generate* {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
|
|
||||||
handle /health {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
|
|
||||||
handle /docs {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
|
|
||||||
handle /openapi.json {
|
|
||||||
reverse_proxy localhost:8000
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Alternative: Use IP:Port format (no domain)
|
# Option 2: IP:Port (comment out option 1 if using this)
|
||||||
# :8080 {
|
# :8080 {
|
||||||
# reverse_proxy localhost:3080
|
# reverse_proxy localhost:3080
|
||||||
#
|
|
||||||
# handle /projects* {
|
|
||||||
# reverse_proxy localhost:8000
|
|
||||||
# }
|
|
||||||
# handle /edits* {
|
|
||||||
# reverse_proxy localhost:8000
|
|
||||||
# }
|
|
||||||
# handle /patches* {
|
|
||||||
# reverse_proxy localhost:8000
|
|
||||||
# }
|
|
||||||
# handle /generate* {
|
|
||||||
# reverse_proxy localhost:8000
|
|
||||||
# }
|
|
||||||
# }
|
# }
|
||||||
|
|
||||||
|
# Note: You don't need to specify /projects, /edits, etc.
|
||||||
|
# The frontend's nginx is already configured to proxy those to the backend internally.
|
||||||
|
|||||||
+2
-1
@@ -7,7 +7,7 @@ services:
|
|||||||
dockerfile: Dockerfile
|
dockerfile: Dockerfile
|
||||||
container_name: ai-photo-edit-backend
|
container_name: ai-photo-edit-backend
|
||||||
ports:
|
ports:
|
||||||
- "8000:8000"
|
- "8101:8000" # External 8101, internal 8000
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
- ./backend:/app
|
- ./backend:/app
|
||||||
@@ -17,6 +17,7 @@ services:
|
|||||||
- AI_PROVIDER=${AI_PROVIDER:-mock}
|
- AI_PROVIDER=${AI_PROVIDER:-mock}
|
||||||
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
- OPENAI_API_KEY=${OPENAI_API_KEY:-}
|
||||||
- STABILITY_API_KEY=${STABILITY_API_KEY:-}
|
- STABILITY_API_KEY=${STABILITY_API_KEY:-}
|
||||||
|
- REPLICATE_API_KEY=${REPLICATE_API_KEY:-}
|
||||||
- CORS_ORIGINS=http://localhost:5173,http://localhost:3000,http://localhost
|
- CORS_ORIGINS=http://localhost:5173,http://localhost:3000,http://localhost
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
networks:
|
networks:
|
||||||
|
|||||||
Reference in New Issue
Block a user