From 052d87a7387cba13a7ec565521ce612cb5e89a29 Mon Sep 17 00:00:00 2001 From: AlexBob <5199840@qq.com> Date: Wed, 5 Jun 2024 11:56:09 +0800 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=E6=96=B0=E5=A2=9E=20VS=20C?= =?UTF-8?q?ode=20=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6=E5=92=8C=20Docker=20?= =?UTF-8?q?=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +--- ui-work/.vscode/extensions.json | 6 +++++ ui-work/.vscode/launch.json | 20 ++++++++++++++++ ui-work/.vscode/tasks.json | 42 +++++++++++++++++++++++++++++++++ ui-work/docker/Dockerfile | 5 ++++ ui-work/docker/web.json | 35 +++++++++++++++++++++++++++ 6 files changed, 109 insertions(+), 4 deletions(-) create mode 100644 ui-work/.vscode/extensions.json create mode 100644 ui-work/.vscode/launch.json create mode 100644 ui-work/.vscode/tasks.json create mode 100644 ui-work/docker/Dockerfile create mode 100644 ui-work/docker/web.json diff --git a/.gitignore b/.gitignore index 8e53ff72..30dddaec 100644 --- a/.gitignore +++ b/.gitignore @@ -26,7 +26,4 @@ out/ /nbbuild/ /dist/ /nbdist/ -/.nb-gradle/ - -### VS Code ### -.vscode/ \ No newline at end of file +/.nb-gradle/ \ No newline at end of file diff --git a/ui-work/.vscode/extensions.json b/ui-work/.vscode/extensions.json new file mode 100644 index 00000000..0409dbe3 --- /dev/null +++ b/ui-work/.vscode/extensions.json @@ -0,0 +1,6 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846 + "recommendations": [ + "angular.ng-template" + ] +} diff --git a/ui-work/.vscode/launch.json b/ui-work/.vscode/launch.json new file mode 100644 index 00000000..925af837 --- /dev/null +++ b/ui-work/.vscode/launch.json @@ -0,0 +1,20 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "ng serve", + "type": "chrome", + "request": "launch", + "preLaunchTask": "npm: start", + "url": "http://localhost:4200/" + }, + { + "name": "ng test", + "type": "chrome", + "request": "launch", + "preLaunchTask": "npm: test", + "url": "http://localhost:9876/debug.html" + } + ] +} diff --git a/ui-work/.vscode/tasks.json b/ui-work/.vscode/tasks.json new file mode 100644 index 00000000..a298b5bd --- /dev/null +++ b/ui-work/.vscode/tasks.json @@ -0,0 +1,42 @@ +{ + // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558 + "version": "2.0.0", + "tasks": [ + { + "type": "npm", + "script": "start", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + }, + { + "type": "npm", + "script": "test", + "isBackground": true, + "problemMatcher": { + "owner": "typescript", + "pattern": "$tsc", + "background": { + "activeOnStart": true, + "beginsPattern": { + "regexp": "(.*?)" + }, + "endsPattern": { + "regexp": "bundle generation complete" + } + } + } + } + ] +} diff --git a/ui-work/docker/Dockerfile b/ui-work/docker/Dockerfile new file mode 100644 index 00000000..3be8e2d3 --- /dev/null +++ b/ui-work/docker/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:latest + +LABEL maintainer="Unit Contributors billbob.dong@gmail.com" + +COPY ./web/browser/** /usr/share/nginx/html diff --git a/ui-work/docker/web.json b/ui-work/docker/web.json new file mode 100644 index 00000000..1f7844e1 --- /dev/null +++ b/ui-work/docker/web.json @@ -0,0 +1,35 @@ +{ + "listeners": { + "*:80": { + "pass": "routes" + } + }, + "routes": [ + { + "match": { + "uri": "/api/*" + }, + "action": { + "proxy": "http://127.0.0.1:8080" + } + }, + { + "action": { + "share": "/www/web$uri", + "index": "index.html", + "types": [ + "image/*", + "font/*", + "text/*" + ], + "response_headers": { + "Cache-Control": "max-age=1209600" + }, + "fallback": { + "share": "/www/web$uri", + "index": "index.html" + } + } + } + ] +}