refactor: rename canto-backend → backend, canto-frontend → frontend
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
55
backend/deploy/nginx.conf
Normal file
55
backend/deploy/nginx.conf
Normal file
@@ -0,0 +1,55 @@
|
||||
upstream canto_backend {
|
||||
server 127.0.0.1:8000;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name your-domain.com;
|
||||
|
||||
client_max_body_size 100M;
|
||||
client_body_timeout 300s;
|
||||
proxy_read_timeout 300s;
|
||||
proxy_connect_timeout 300s;
|
||||
proxy_send_timeout 300s;
|
||||
|
||||
location / {
|
||||
proxy_pass http://canto_backend;
|
||||
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;
|
||||
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS' always;
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type' always;
|
||||
|
||||
if ($request_method = 'OPTIONS') {
|
||||
add_header 'Access-Control-Allow-Origin' '*';
|
||||
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
|
||||
add_header 'Access-Control-Allow-Headers' 'Authorization, Content-Type';
|
||||
add_header 'Content-Length' '0';
|
||||
add_header 'Content-Type' 'text/plain';
|
||||
return 204;
|
||||
}
|
||||
}
|
||||
|
||||
location /outputs/ {
|
||||
alias /opt/canto-backend/outputs/;
|
||||
autoindex off;
|
||||
add_header Cache-Control "public, max-age=3600";
|
||||
add_header Content-Disposition "attachment";
|
||||
}
|
||||
|
||||
location /health {
|
||||
proxy_pass http://canto_backend/health;
|
||||
proxy_set_header Host $host;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /metrics {
|
||||
proxy_pass http://canto_backend/metrics;
|
||||
proxy_set_header Host $host;
|
||||
allow 127.0.0.1;
|
||||
deny all;
|
||||
}
|
||||
}
|
||||
21
backend/deploy/qwen-tts.service
Normal file
21
backend/deploy/qwen-tts.service
Normal file
@@ -0,0 +1,21 @@
|
||||
[Unit]
|
||||
Description=Canto Backend API Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
User=qwen-tts
|
||||
Group=qwen-tts
|
||||
WorkingDirectory=/opt/canto-backend
|
||||
Environment="PATH=/opt/conda/envs/canto/bin:/usr/local/bin:/usr/bin:/bin"
|
||||
EnvironmentFile=/opt/canto-backend/.env
|
||||
ExecStart=/opt/conda/envs/canto/bin/python main.py
|
||||
Restart=on-failure
|
||||
RestartSec=10s
|
||||
StandardOutput=append:/var/log/qwen-tts/app.log
|
||||
StandardError=append:/var/log/qwen-tts/error.log
|
||||
TimeoutStopSec=30s
|
||||
KillMode=mixed
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
Reference in New Issue
Block a user