commit cbd7bf0c51c49d1c6450cf066a9650f27cee4846 Author: Evan Chen Date: Sun Oct 24 03:51:48 2021 +0800 update diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..651539e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM golang:1.17.2 + +RUN curl -fsSL https://kumoly.io/attachments/f74b4920-2798-4a01-ade2-8bb22171a949 | tar -C /usr/local/bin/ -xz + +WORKDIR /src + +COPY main.go main.go +RUN touch shell.sh + +CMD [ "configui", "-log", "configui.log", "-f","conf.json" ] \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8f96ae --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# Go Playground + diff --git a/conf.json b/conf.json new file mode 100644 index 0000000..a65ea27 --- /dev/null +++ b/conf.json @@ -0,0 +1,39 @@ +{ + "app_name": "Go Playground", + "config_path": "/data/configui.json", + "no_reconfig": true, + "allow_ip": "", + "files": [ + { + "path": "main.go", + "name": "Main", + "action": "go run main.go", + "ro": false, + "lang": "", + "order": -1, + "data": "" + }, + { + "path": "shell.sh", + "name": "Shell", + "action": "bash shell.sh", + "ro": false, + "lang": "", + "order": 1, + "data": "" + }, + { + "path": "./configui.log", + "name": "log", + "action": "", + "ro": false, + "lang": "", + "order": 2, + "data": "" + } + ], + "result_bellow": false, + "hide_config": true, + "log_path": "/var/log/configui.log", + "silent_sys_out": false + } \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..883a9c6 --- /dev/null +++ b/docker-compose.yaml @@ -0,0 +1,9 @@ +services: + go-playground: + build: . + container_name: go-playground + restart: always + ports: + - 127.0.0.1:18000:8000 + volumes: + - ./conf.json:/src/conf.json diff --git a/main.go b/main.go new file mode 100644 index 0000000..91cca4f --- /dev/null +++ b/main.go @@ -0,0 +1,7 @@ +package main + +import "fmt" + +func main() { + fmt.Println("Hello, world.") +}