Initial
This commit is contained in:
commit
97dc0a3570
78 files changed
+7054
No files matched your search
@@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
# Render /etc/nginx/templates/*.template into /etc/nginx/conf.d/ using the
|
||||
# current environment (BACKEND_HOST, BACKEND_PORT, ...). The stock nginx image
|
||||
# does this automatically, but we start nginx via supervisord, so do it here.
|
||||
mkdir -p /etc/nginx/conf.d
|
||||
envsubst '${BACKEND_HOST} ${BACKEND_PORT}' \
|
||||
< /etc/nginx/templates/default.conf.template \
|
||||
> /etc/nginx/conf.d/default.conf
|
||||
|
||||
exec /usr/bin/supervisord -c /etc/supervisord.conf
|
||||
@@ -0,0 +1,33 @@
|
||||
# Serves the built SPA and proxies /api to the backend in the same container.
|
||||
# Rendered by the nginx image's envsubst step into /etc/nginx/conf.d/default.conf.
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# The SPA handles the API itself; don't announce the server version.
|
||||
server_tokens off;
|
||||
|
||||
# SPA fallback: unknown paths render the app, so client-side routes like
|
||||
# /rooms/daily-standup work on refresh and deep links.
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
|
||||
location = /index.html {
|
||||
add_header Cache-Control "no-store";
|
||||
}
|
||||
|
||||
# Proxy the API to the Go backend running alongside nginx.
|
||||
location /api/ {
|
||||
proxy_pass http://${BACKEND_HOST}:${BACKEND_PORT};
|
||||
proxy_http_version 1.1;
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
[supervisord]
|
||||
nodaemon=true
|
||||
logfile=/dev/null
|
||||
logfile_maxbytes=0
|
||||
pidfile=/run/supervisord.pid
|
||||
|
||||
# The Go backend, listening on loopback only. It inherits the container
|
||||
# environment (ADDR, DB_PATH, JITSI_*, COOKIE_SECURE, ...), so configuration set
|
||||
# via docker-compose `environment`/`env_file` reaches it unchanged. ADDR and
|
||||
# DB_PATH also have sensible defaults baked into the image (see Dockerfile).
|
||||
[program:backend]
|
||||
command=/app/server
|
||||
directory=/app
|
||||
autorestart=true
|
||||
startsecs=1
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
|
||||
# nginx in the foreground.
|
||||
[program:nginx]
|
||||
command=nginx -g 'daemon off;'
|
||||
autorestart=true
|
||||
startsecs=1
|
||||
stdout_logfile=/dev/stdout
|
||||
stdout_logfile_maxbytes=0
|
||||
stderr_logfile=/dev/stderr
|
||||
stderr_logfile_maxbytes=0
|
||||
Reference in new issue
Block a user