master
Evan Chen 2021-11-17 14:32:44 +08:00
parent 53432c7f01
commit 532042891b
1 changed files with 25 additions and 3 deletions

View File

@ -4,6 +4,30 @@ WORKDIR /src
RUN touch shell.sh
RUN \
# gterm \
curl -fsSL https://kumoly.io/attachments/acfc99c7-28c7-4886-bb7d-783c3a6a8c64 | tar -C /usr/local/bin/ -xz &&\
# configui \
curl -fsSL https://kumoly.io/attachments/cefc7869-2a61-4487-a155-ad891cea9abd | 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 echo '#!/bin/sh\n\
echo "starting shell service..."\n\
gterm -addr :8080 -name GoPlayground &\n\
echo "starting configui..."\n\
configui -log configui.log -f conf.json -bind :8001 &\n\
caddy run --config Caddyfile\n\
' > /entrypoint.sh
RUN echo '\
:8000 {\n\
route /sh/* {\n\
uri strip_prefix /sh\n\
reverse_proxy localhost:8080\n\
}\n\
reverse_proxy localhost:8001\n\
}' > Caddyfile
RUN echo '{"app_name":"Go Playground","no_reconfig":true \
,"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}' > conf.json
@ -17,6 +41,4 @@ func main() {\n\
}\n' > main.go
RUN curl -fsSL https://kumoly.io/attachments/f2ad2283-d5c3-4d55-8941-1fc5f3f7de38 | tar -C /usr/local/bin/ -xz
CMD [ "configui", "-log", "configui.log", "-f","conf.json" ]
ENTRYPOINT ["/bin/sh","/entrypoint.sh"]