add console
Browse files- Dockerfile +2 -0
- app/start.sh +2 -4
- default +11 -0
Dockerfile
CHANGED
@@ -26,5 +26,7 @@ COPY --chown=user:user ./requirements.txt /home/user/requirements.txt
|
|
26 |
RUN pip install --no-cache-dir --upgrade -r /home/user/requirements.txt
|
27 |
COPY --chown=user:user ./app /home/user/app
|
28 |
COPY ./default /etc/nginx/sites-available
|
|
|
|
|
29 |
EXPOSE 7860
|
30 |
CMD ["/bin/sh", "/home/user/app/start.sh"]
|
|
|
26 |
RUN pip install --no-cache-dir --upgrade -r /home/user/requirements.txt
|
27 |
COPY --chown=user:user ./app /home/user/app
|
28 |
COPY ./default /etc/nginx/sites-available
|
29 |
+
RUN wget https://github.com/tsl0922/ttyd/releases/download/1.7.3/ttyd.x86_64 -O /usr/local/bin/ttyd && \
|
30 |
+
chmod 755 /usr/local/bin/ttyd
|
31 |
EXPOSE 7860
|
32 |
CMD ["/bin/sh", "/home/user/app/start.sh"]
|
app/start.sh
CHANGED
@@ -2,11 +2,9 @@
|
|
2 |
set -e
|
3 |
|
4 |
cd /home/user/app
|
|
|
5 |
|
6 |
-
|
7 |
-
ls -ld /var/log/nginx/ /var/lib/nginx/ /run
|
8 |
-
ls -la /
|
9 |
-
ls -la ~
|
10 |
|
11 |
nginx
|
12 |
|
|
|
2 |
set -e
|
3 |
|
4 |
cd /home/user/app
|
5 |
+
echo "Console Auth <$CONSOLE_AUTH>"
|
6 |
|
7 |
+
/usr/local/bin/ttyd -c user:testxyz1 -p 7681 /bin/bash
|
|
|
|
|
|
|
8 |
|
9 |
nginx
|
10 |
|
default
CHANGED
@@ -61,6 +61,17 @@ server {
|
|
61 |
proxy_set_header Connection "upgrade";
|
62 |
}
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
# pass PHP scripts to FastCGI server
|
66 |
#
|
|
|
61 |
proxy_set_header Connection "upgrade";
|
62 |
}
|
63 |
|
64 |
+
location ~ ^/console(.*)$ {
|
65 |
+
proxy_http_version 1.1;
|
66 |
+
proxy_set_header Host $host;
|
67 |
+
proxy_set_header X-Real-IP $remote_addr;
|
68 |
+
proxy_set_header X-Forwarded-Proto $scheme;
|
69 |
+
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
70 |
+
proxy_set_header Upgrade $http_upgrade;
|
71 |
+
proxy_set_header Connection "upgrade";
|
72 |
+
proxy_pass http://localhost:7681/$1;
|
73 |
+
}
|
74 |
+
|
75 |
|
76 |
# pass PHP scripts to FastCGI server
|
77 |
#
|