mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-17 00:41:31 +00:00
Add a fallback port for the terminal to avoid crashing proxies
This commit is contained in:
parent
251bc6325a
commit
641709c04e
14
Dockerfile
14
Dockerfile
@ -4,6 +4,7 @@ FROM avatao/debian:buster
|
||||
RUN apt-get update &&\
|
||||
apt-get install -y --no-install-recommends \
|
||||
supervisor \
|
||||
ncat \
|
||||
libzmq5 \
|
||||
nginx \
|
||||
jq \
|
||||
@ -19,12 +20,13 @@ RUN curl -Ls https://github.com/krallin/tini/releases/download/v0.18.0/tini-amd6
|
||||
sha256sum --check --status &&\
|
||||
chmod 755 /bin/init
|
||||
|
||||
ENV TFW_PUBLIC_PORT=8888 \
|
||||
TFW_WEB_PORT=4242 \
|
||||
TFW_LOGIN_APP_PORT=6666 \
|
||||
TFW_TERMINADO_PORT=7878 \
|
||||
TFW_SUPERVISOR_HTTP_PORT=9001 \
|
||||
TFW_PUB_PORT=7654 \
|
||||
ENV TFW_PUBLIC_PORT=8888 \
|
||||
TFW_WEB_PORT=4242 \
|
||||
TFW_LOGIN_APP_PORT=6666 \
|
||||
TFW_TERMINAL_PORT=7878 \
|
||||
TFW_TERMINAL_FALLBACK_PORT=7879 \
|
||||
TFW_SUPERVISOR_HTTP_PORT=9001 \
|
||||
TFW_PUB_PORT=7654 \
|
||||
TFW_PULL_PORT=8765
|
||||
|
||||
EXPOSE ${TFW_PUBLIC_PORT}
|
||||
|
@ -1,5 +1,5 @@
|
||||
location = /terminal {
|
||||
proxy_pass http://127.0.0.1:${TFW_TERMINADO_PORT};
|
||||
proxy_pass http://terminal;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection "upgrade";
|
||||
|
@ -1,3 +1,8 @@
|
||||
upstream terminal {
|
||||
server 127.0.0.1:${TFW_TERMINAL_PORT};
|
||||
server 127.0.0.1:${TFW_TERMINAL_FALLBACK_PORT} backup;
|
||||
}
|
||||
|
||||
server {
|
||||
listen ${TFW_PUBLIC_PORT};
|
||||
server_name localhost;
|
||||
|
4
supervisor/components/terminal_fallback.conf
Normal file
4
supervisor/components/terminal_fallback.conf
Normal file
@ -0,0 +1,4 @@
|
||||
[program:terminal_fallback]
|
||||
command=ncat -klp %(ENV_TFW_TERMINAL_FALLBACK_PORT)s
|
||||
autostart=true
|
||||
autorestart=true
|
Loading…
Reference in New Issue
Block a user