Some checks failed
CD Pipeline / deploy (push) Failing after 59s
- 建立 Gitea Actions CD pipeline (.gitea/workflows/cd.yaml) - 部署模式: rsync Python 檔案至 188 → docker restart (volume mount) - Dockerfile/requirements 變動時自動重建 Docker image - 部署通知: Telegram (開始/成功/失敗) - 健康檢查: https://mo.wooo.work/health (最多 5 次重試) - 同步最新 CLAUDE.md / ADR-008 / memory (2026-04-19) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
70 lines
1.7 KiB
Plaintext
70 lines
1.7 KiB
Plaintext
# =============================================================================
|
|
# WOOO TECH - Momo Pro System
|
|
# Nginx Site Configuration
|
|
# =============================================================================
|
|
|
|
upstream momo_app {
|
|
server momo-app:5000;
|
|
keepalive 32;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
server_name localhost;
|
|
|
|
# 日誌
|
|
access_log /var/log/nginx/momo-access.log main;
|
|
error_log /var/log/nginx/momo-error.log;
|
|
|
|
# 靜態檔案
|
|
location /static/ {
|
|
alias /app/static/;
|
|
expires 7d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
location /web/static/ {
|
|
alias /app/web/static/;
|
|
expires 7d;
|
|
add_header Cache-Control "public, immutable";
|
|
}
|
|
|
|
# 反向代理到 Flask 應用
|
|
location / {
|
|
proxy_pass http://momo_app;
|
|
proxy_http_version 1.1;
|
|
|
|
# Proxy headers
|
|
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;
|
|
proxy_set_header Connection "";
|
|
|
|
# Timeout 設定(配合長時間查詢)
|
|
proxy_connect_timeout 300s;
|
|
proxy_send_timeout 300s;
|
|
proxy_read_timeout 300s;
|
|
|
|
# Buffer 設定
|
|
proxy_buffering on;
|
|
proxy_buffer_size 128k;
|
|
proxy_buffers 4 256k;
|
|
proxy_busy_buffers_size 256k;
|
|
}
|
|
|
|
# 健康檢查端點
|
|
location /health {
|
|
access_log off;
|
|
proxy_pass http://momo_app;
|
|
proxy_connect_timeout 5s;
|
|
proxy_read_timeout 5s;
|
|
}
|
|
|
|
# 錯誤頁面
|
|
error_page 500 502 503 504 /50x.html;
|
|
location = /50x.html {
|
|
root /usr/share/nginx/html;
|
|
}
|
|
}
|