From 2a7538bb70d07c52795598a6ac7e94e3784f249c Mon Sep 17 00:00:00 2001 From: neverteaser Date: Wed, 17 Mar 2021 19:28:37 +0800 Subject: [PATCH] fix(be):add playground & change log dir --- .gitignore | 22 +++++++++++++++- main.go | 2 +- playground/docker-compose.yml | 49 +++++++++++++++++++++++++++++++++++ 3 files changed, 71 insertions(+), 2 deletions(-) create mode 100644 playground/docker-compose.yml diff --git a/.gitignore b/.gitignore index 6f4c7f7..224e4ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,24 @@ web/build *.db .DS_Store .eslintcache -.env \ No newline at end of file +.env + +# Binaries for programs and plugins +*.exe +*.exe~ +*.dll +*.so +*.dylib + +# ignore ide config +.idea +.vscode + +# vim +*.swp + + +# playground +playground/next-terminal + +/log \ No newline at end of file diff --git a/main.go b/main.go index 03aa5b0..60fc13e 100644 --- a/main.go +++ b/main.go @@ -45,7 +45,7 @@ func Run() error { writer1 := &bytes.Buffer{} writer2 := os.Stdout - writer3, err := os.OpenFile("next-terminal.log", os.O_WRONLY|os.O_CREATE, 0755) + writer3, err := os.OpenFile("log/next-terminal.log", os.O_WRONLY|os.O_CREATE, 0755) if err != nil { log.Fatalf("create file log.txt failed: %v", err) } diff --git a/playground/docker-compose.yml b/playground/docker-compose.yml new file mode 100644 index 0000000..7918986 --- /dev/null +++ b/playground/docker-compose.yml @@ -0,0 +1,49 @@ +version: '3.3' +services: + mysql: + image: mysql:8.0 + container_name: mysql + environment: + MYSQL_DATABASE: next-terminal + MYSQL_USER: next-terminal + MYSQL_PASSWORD: next-terminal + MYSQL_ROOT_PASSWORD: next-terminal + volumes: + - ./data/mysql_data:/var/lib/mysql + ports: + - "3306:3306" + restart: + always + networks: + next-terminal: + ipv4_address: 172.77.77.2 + + next-terminal: + container_name: next-terminal + image: "dushixiang/next-terminal:latest" + environment: + DB: "mysql" + MYSQL_HOSTNAME: "mysql" + MYSQL_PORT: 3306 + MYSQL_USERNAME: "next-terminal" + MYSQL_PASSWORD: "next-terminal" + MYSQL_DATABASE: "next-terminal" + ports: + - "8088:8088" + volumes: + - ./drive:/usr/local/next-terminal/drive + - ./recording:/usr/local/next-terminal/recording + depends_on: + - mysql + networks: + next-terminal: + ipv4_address: 172.77.77.3 + restart: + always + +networks: + next-terminal: + ipam: + driver: default + config: + - subnet: "172.77.77.0/24" \ No newline at end of file