mirror of
https://github.com/AppFlowy-IO/AppFlowy-Web.git
synced 2026-03-13 10:00:26 +08:00
chore: health endpoint for probe
This commit is contained in:
@@ -39,7 +39,7 @@ COPY --from=builder /app/dist /app/dist
|
||||
|
||||
# Copy only necessary files for SSR
|
||||
COPY deploy/server.ts /app/server.ts
|
||||
COPY deploy/nginx.conf /etc/nginx/nginx.conf
|
||||
COPY docker/nginx-ssr.conf /etc/nginx/nginx.conf
|
||||
COPY docker/supervisord-ssr.conf /etc/supervisor/conf.d/supervisord.conf
|
||||
COPY docker/entrypoint-ssr.sh /docker-entrypoint.sh
|
||||
|
||||
|
||||
123
docker/nginx-ssr.conf
Normal file
123
docker/nginx-ssr.conf
Normal file
@@ -0,0 +1,123 @@
|
||||
# nginx-ssr.conf - Docker-specific nginx configuration for SSR
|
||||
user www-data; # Debian/Ubuntu default user
|
||||
worker_processes auto;
|
||||
|
||||
error_log /var/log/nginx/error.log notice;
|
||||
pid /var/run/nginx.pid;
|
||||
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
include /etc/nginx/mime.types;
|
||||
default_type application/octet-stream;
|
||||
|
||||
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
|
||||
'$status $body_bytes_sent "$http_referer" '
|
||||
'"$http_user_agent" "$http_x_forwarded_for"';
|
||||
|
||||
access_log /var/log/nginx/access.log main;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 65;
|
||||
|
||||
# Gzip compression
|
||||
gzip on;
|
||||
gzip_static on;
|
||||
gzip_http_version 1.0;
|
||||
gzip_comp_level 5;
|
||||
gzip_vary on;
|
||||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript application/wasm;
|
||||
|
||||
# Main server block
|
||||
server {
|
||||
listen 80;
|
||||
server_name localhost;
|
||||
|
||||
# Health check endpoint (for Kubernetes readiness probe)
|
||||
location /health {
|
||||
access_log off;
|
||||
return 200 "healthy\n";
|
||||
add_header Content-Type text/plain;
|
||||
}
|
||||
|
||||
# Main application - proxy to Bun SSR server
|
||||
location / {
|
||||
proxy_pass http://localhost:3000;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
|
||||
# Timeout settings for SSR
|
||||
proxy_connect_timeout 30s;
|
||||
proxy_send_timeout 30s;
|
||||
proxy_read_timeout 30s;
|
||||
}
|
||||
|
||||
# Static assets - serve directly from nginx
|
||||
location /static/ {
|
||||
root /usr/share/nginx/html;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /appflowy.svg {
|
||||
root /usr/share/nginx/html;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /appflowy.ico {
|
||||
root /usr/share/nginx/html;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /og-image.png {
|
||||
root /usr/share/nginx/html;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /covers/ {
|
||||
root /usr/share/nginx/html;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location /af_icons/ {
|
||||
root /usr/share/nginx/html;
|
||||
expires 30d;
|
||||
access_log off;
|
||||
add_header 'Access-Control-Allow-Origin' '*' always;
|
||||
add_header 'Access-Control-Allow-Methods' 'GET' always;
|
||||
}
|
||||
|
||||
# Apple/Android app association files
|
||||
location /.well-known/apple-app-site-association {
|
||||
root /usr/share/nginx/html;
|
||||
default_type application/json;
|
||||
add_header Cache-Control "public, max-age=3600";
|
||||
}
|
||||
|
||||
location /.well-known/assetlinks.json {
|
||||
root /usr/share/nginx/html;
|
||||
default_type application/json;
|
||||
add_header Cache-Control "public, max-age=3600";
|
||||
}
|
||||
|
||||
# Error pages
|
||||
error_page 404 /404.html;
|
||||
location = /404.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
|
||||
error_page 500 502 503 504 /50x.html;
|
||||
location = /50x.html {
|
||||
root /usr/share/nginx/html;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,8 +7,12 @@ pidfile=/var/run/supervisord.pid
|
||||
command=/usr/sbin/nginx -g "daemon off;"
|
||||
autostart=true
|
||||
autorestart=true
|
||||
stdout_logfile=/var/log/nginx/access.log
|
||||
stderr_logfile=/var/log/nginx/error.log
|
||||
stdout_logfile=/var/log/supervisor/nginx.stdout.log
|
||||
stderr_logfile=/var/log/supervisor/nginx.stderr.log
|
||||
stdout_logfile_maxbytes=10MB
|
||||
stdout_logfile_backups=10
|
||||
stderr_logfile_maxbytes=10MB
|
||||
stderr_logfile_backups=10
|
||||
priority=10
|
||||
|
||||
[program:bun]
|
||||
|
||||
Reference in New Issue
Block a user