From a1e012c8eb3298ad40b2edbb093ccd94a72f8525 Mon Sep 17 00:00:00 2001 From: qq Date: Sat, 12 Feb 2022 11:09:31 +0800 Subject: [PATCH] first commit --- .obsidian/app.json | 1 + .obsidian/appearance.json | 3 ++ .obsidian/core-plugins.json | 15 ++++++ .obsidian/hotkeys.json | 1 + .obsidian/workspace | 93 +++++++++++++++++++++++++++++++++++++ README.md | 1 + system/config.ini | 53 +++++++++++++++++++++ system/docker-compose.yml | 23 +++++++++ ui/docker-compose.yml | 22 +++++++++ ui/nginx.conf | 33 +++++++++++++ 10 files changed, 245 insertions(+) create mode 100644 .obsidian/app.json create mode 100644 .obsidian/appearance.json create mode 100644 .obsidian/core-plugins.json create mode 100644 .obsidian/hotkeys.json create mode 100644 .obsidian/workspace create mode 100644 README.md create mode 100644 system/config.ini create mode 100644 system/docker-compose.yml create mode 100644 ui/docker-compose.yml create mode 100644 ui/nginx.conf diff --git a/.obsidian/app.json b/.obsidian/app.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/app.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json new file mode 100644 index 0000000..990f337 --- /dev/null +++ b/.obsidian/appearance.json @@ -0,0 +1,3 @@ +{ + "baseFontSize": 16 +} \ No newline at end of file diff --git a/.obsidian/core-plugins.json b/.obsidian/core-plugins.json new file mode 100644 index 0000000..ab1d511 --- /dev/null +++ b/.obsidian/core-plugins.json @@ -0,0 +1,15 @@ +[ + "file-explorer", + "global-search", + "switcher", + "graph", + "backlink", + "page-preview", + "note-composer", + "command-palette", + "editor-status", + "markdown-importer", + "word-count", + "open-with-default-app", + "file-recovery" +] \ No newline at end of file diff --git a/.obsidian/hotkeys.json b/.obsidian/hotkeys.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/.obsidian/hotkeys.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/.obsidian/workspace b/.obsidian/workspace new file mode 100644 index 0000000..282b34d --- /dev/null +++ b/.obsidian/workspace @@ -0,0 +1,93 @@ +{ + "main": { + "id": "8a34247877f48c3a", + "type": "split", + "children": [ + { + "id": "357fba603d9f8482", + "type": "leaf", + "state": { + "type": "markdown", + "state": { + "file": "README.md", + "mode": "source" + } + } + } + ], + "direction": "vertical" + }, + "left": { + "id": "14e5b9a177192bc5", + "type": "split", + "children": [ + { + "id": "5c94a9d37308b17e", + "type": "tabs", + "children": [ + { + "id": "36bfcaf61dce390f", + "type": "leaf", + "state": { + "type": "file-explorer", + "state": {} + } + }, + { + "id": "c86591ceb9a77cac", + "type": "leaf", + "state": { + "type": "search", + "state": { + "query": "", + "matchingCase": false, + "explainSearch": false, + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical" + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300 + }, + "right": { + "id": "386754b134ca342d", + "type": "split", + "children": [ + { + "id": "042858336e17d256", + "type": "tabs", + "children": [ + { + "id": "e341806c4007e45e", + "type": "leaf", + "state": { + "type": "backlink", + "state": { + "file": "README.md", + "collapseAll": false, + "extraContext": false, + "sortOrder": "alphabetical", + "showSearch": false, + "searchQuery": "", + "backlinkCollapsed": false, + "unlinkedCollapsed": true + } + } + } + ] + } + ], + "direction": "horizontal", + "width": 300, + "collapsed": true + }, + "active": "357fba603d9f8482", + "lastOpenFiles": [ + "README.md" + ] +} \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..87d31c6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +-- golang后台 和 前端代码启动的docker \ No newline at end of file diff --git a/system/config.ini b/system/config.ini new file mode 100644 index 0000000..8c2ac60 --- /dev/null +++ b/system/config.ini @@ -0,0 +1,53 @@ +[app] +port = 8666 +debug = true +tokenTimeout = 43200 +jwtSecret = TaZT61grR6V7A4JAJZlX47mc89lGCKYo +pwdSecret = oEjVsLBOtyMwxJRy2fXgM1ibfY9Paq6l +emailHandleUrl = "http://8.210.153.118:8665/check" +sendEmail= "wannengchongplatform@gmail.com" +sendEmailPassword= "zP40vxfjDBmmgq229D55" +noticeUrl = http://8.210.160.78:8066/notice/one + +[mysql.system] +;https://github.com/go-sql-driver/mysql +host = 192.168.0.118 +port = 3306 +dbname = platform_system_db +username = root +password = YnHuUuYTSEdgv7 +charset = utf8mb4 +collation = utf8mb4_general_ci +loc = Asia/Shanghai +maxAllowedPacket = 8388608 +timeout = 30s +readTimeout = 1m30s +writeTimeout = 1m30s + +[mysql.register] +;https://github.com/go-sql-driver/mysql +host = 192.168.0.118 +port = 3306 +dbname = platform_register_db +username = root +password = YnHuUuYTSEdgv7 +charset = utf8mb4 +collation = utf8mb4_general_ci +loc = Asia/Shanghai +maxAllowedPacket = 8388608 +timeout = 30s +readTimeout = 1m30s +writeTimeout = 1m30s + +[redis.manage] +;https://godoc.org/github.com/go-redis/redis#Options +host = 127.0.0.1 +port = 6377 +password = nekopara999 +database = 0 +dialTimeout = 5 +readTimeout = 3 +writeTimeout = 3 +idleTimeout = 300 +poolSize = 10 +minIdleConns = 10 diff --git a/system/docker-compose.yml b/system/docker-compose.yml new file mode 100644 index 0000000..7981693 --- /dev/null +++ b/system/docker-compose.yml @@ -0,0 +1,23 @@ +version: '2' + +services: + + platform_go: + image: golang:latest + container_name: client_go + working_dir: /apps + volumes: + - ./config.ini:/apps/config.ini + - ./client.bin:/apps/client.bin + environment: + TZ: "Asia/Shanghai" + ports: + - "8666:8666" + logging: + driver: "json-file" + options: + max-size: "10240k" + max-file: "10" + network_mode: "bridge" + command: ./client.bin + restart: always \ No newline at end of file diff --git a/ui/docker-compose.yml b/ui/docker-compose.yml new file mode 100644 index 0000000..1ed7897 --- /dev/null +++ b/ui/docker-compose.yml @@ -0,0 +1,22 @@ +version: "3.5" + +services: + client-ui: + image: nginx:latest + container_name: client-ui + volumes: + - ./dist:/usr/share/nginx/html:ro + - ./nginx.conf:/etc/nginx/conf.d/default.conf:ro + environment: + TZ: "Asia/Shanghai" + ports: + - 8665:80 + logging: + driver: "json-file" + options: + max-size: "10240k" + max-file: "10" + network_mode: "bridge" + command: /bin/bash -c "nginx -g 'daemon off;'" + restart: always + diff --git a/ui/nginx.conf b/ui/nginx.conf new file mode 100644 index 0000000..784c14a --- /dev/null +++ b/ui/nginx.conf @@ -0,0 +1,33 @@ +charset utf-8; +server_tokens off; + +gzip on; +gzip_min_length 1k; +gzip_comp_level 9; +gzip_types text/plain text/css text/javascript application/json application/javascript application/x-javascript application/xml; +gzip_vary on; +gzip_disable "MSIE [1-6]\."; + +upstream go.api { + server 192.168.0.118:8666; +} + +server { + listen 80 default; + server_tokens off; + + location /api { + proxy_pass http://go.api; + proxy_set_header X-Forwarded-Proto $scheme; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + + rewrite ^/api/(.*)$ /$1 break; + } + + location / { + root /usr/share/nginx/html; + try_files $uri $uri/ /index.html; + } + +} \ No newline at end of file