update
parent
8894346152
commit
742dda9ae4
31
Dockerfile
31
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
|
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 && \
|
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 '\
|
echo '\
|
||||||
:8000 {\n\
|
:8000 {\n\
|
||||||
route /sh/* {\n\
|
route /sh/* {\n\
|
||||||
|
@ -25,23 +17,34 @@ echo '\
|
||||||
reverse_proxy localhost:8080\n\
|
reverse_proxy localhost:8080\n\
|
||||||
}\n\
|
}\n\
|
||||||
reverse_proxy localhost:8001\n\
|
reverse_proxy localhost:8001\n\
|
||||||
}' > Caddyfile && \
|
}' > /Caddyfile && \
|
||||||
echo '\
|
echo '\
|
||||||
{{ define "links" }}\n\
|
{{ define "links" }}\n\
|
||||||
<a class="button is-white level-item" \n\
|
<a class="button is-white level-item" \n\
|
||||||
href="sh/"\n\
|
href="sh/"\n\
|
||||||
>Shell</a>\n\
|
>Shell</a>\n\
|
||||||
{{end}}\n\
|
{{end}}\n\
|
||||||
' > links.tmpl && \
|
' > /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 && \
|
|
||||||
echo 'package main\n\
|
echo 'package main\n\
|
||||||
\n\
|
\n\
|
||||||
import "fmt"\n\
|
import "fmt"\n\
|
||||||
\n\
|
\n\
|
||||||
func main() {\n\
|
func main() {\n\
|
||||||
fmt.Println("Hello, world.")\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"]
|
ENTRYPOINT ["/bin/bash","/entrypoint.sh"]
|
||||||
|
|
Loading…
Reference in New Issue