From 742dda9ae41f52aaa1d3dca961389ccc5aa8988a Mon Sep 17 00:00:00 2001 From: Evan Chen Date: Thu, 18 Nov 2021 02:50:12 +0800 Subject: [PATCH] update --- Dockerfile | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index 02d1795..a0dab3b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,14 +10,6 @@ curl -fsSL https://kumoly.io/attachments/e4258c02-1e79-4969-b553-070668498dd4 | curl -fsSL https://github.com/caddyserver/caddy/releases/download/v2.4.6/caddy_2.4.6_linux_amd64.tar.gz | tar -C /usr/local/bin/ -xz RUN touch shell.sh && \ -echo '#!/bin/bash\n\ -echo "starting shell service..."\n\ -gterm -profile > /.profile\n\ -cd /root && gterm -addr :8080 -name GoPlayground -arg "--rcfile" -arg /.profile &\n\ -echo "starting configui..."\n\ -configui -log configui.log -f conf.json -bind :8001 &\n\ -caddy run --config Caddyfile\n\ -' > /entrypoint.sh && \ echo '\ :8000 {\n\ route /sh/* {\n\ @@ -25,23 +17,34 @@ echo '\ reverse_proxy localhost:8080\n\ }\n\ reverse_proxy localhost:8001\n\ -}' > Caddyfile && \ +}' > /Caddyfile && \ echo '\ {{ define "links" }}\n\ Shell\n\ {{end}}\n\ -' > links.tmpl && \ -echo '{"app_name":"Go Playground","no_reconfig":true,"shell": "sh" \ -,"files":[{"path":"main.go","name":"Main","action":"go run main.go","order":-1},{"path":"shell.sh","name":"Shell","action":"bash shell.sh","order":1}] \ -,"hide_config":true,"cust":"."}' > conf.json && \ +' > /links.tmpl && \ echo 'package main\n\ \n\ import "fmt"\n\ \n\ func main() {\n\ fmt.Println("Hello, world.")\n\ -}\n' > main.go +}\n' > main.go && \ +echo '#!/bin/bash\n\ +echo "starting shell service..."\n\ +gterm -profile > /.profile\n\ +cd /root && gterm -addr :8080 -name GoPlayground -arg "--rcfile" -arg /.profile &\n\ +echo "starting configui..."\n\ +echo "setup config ..."\n\ +echo "{\"app_name\":\"Go Playground\",\"no_reconfig\":true,\"shell\": \"bash\",\"hide_config\":true,\"cust\":\"/\",\"files\":[\ +" > /conf.json \n\ +for f in *.go;do if [ "$f" != "main.go" ] ; then echo "{\"path\":\"$f\"},">>/conf.json;fi done \n\ +echo "{\"path\":\"main.go\",\"name\":\"Main\",\"action\":\"go run main.go\",\"order\":-1},">>/conf.json \n\ +echo "{\"path\":\"shell.sh\",\"name\":\"Shell\",\"action\":\"bash shell.sh\",\"order\":1}]}">>/conf.json \n\ +configui -f /conf.json -bind :8001 &\n\ +caddy run --config /Caddyfile\n\ +' > /entrypoint.sh ENTRYPOINT ["/bin/bash","/entrypoint.sh"]