From fbf4a3f4e14c2d4373ff621746401b61558f49b7 Mon Sep 17 00:00:00 2001 From: LinkunGao Date: Mon, 14 Oct 2024 11:52:23 +1300 Subject: [PATCH] add docker file --- docker-compose.yml | 8 ++++++++ dockerfile | 15 +++++++++++++++ frontend/components/model/LeftModel.vue | 4 +++- frontend/nuxt.config.js | 2 +- 4 files changed, 27 insertions(+), 2 deletions(-) create mode 100644 docker-compose.yml create mode 100644 dockerfile diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c2c839e --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,8 @@ +version: "3" +services: + web: + build: + context: ./ + dockerfile: dockerfile + ports: + - "3158:3158" diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..8666dcd --- /dev/null +++ b/dockerfile @@ -0,0 +1,15 @@ +FROM node:16-alpine + +WORKDIR /app + +COPY frontend . + +RUN yarn \ + && yarn generate + + +ENV PORT 3158 + +EXPOSE 3158 + +CMD ["yarn", "start"] \ No newline at end of file diff --git a/frontend/components/model/LeftModel.vue b/frontend/components/model/LeftModel.vue index 0c8351f..85a2f62 100644 --- a/frontend/components/model/LeftModel.vue +++ b/frontend/components/model/LeftModel.vue @@ -94,9 +94,10 @@ export default { }, onNavChange(modelName) { this.navPanelName = modelName; - this.loadModel(this.modelUrlsArray[this.navPanelName][0], this.navPanelName+"left"); + // this.loadModel(this.modelUrlsArray[this.navPanelName][0], this.navPanelName+"left"); }, start() { + if (this.navPanelName === null) { this.loadModel(this.modelUrlsArray.normal[0], this.navPanelName+"left"); }else{ @@ -105,6 +106,7 @@ export default { }, loadModel(model_url, model_name) { + let viewURL = ""; if (this.navPanelName === null) { viewURL = this.modelUrlsArray.normal[1]; diff --git a/frontend/nuxt.config.js b/frontend/nuxt.config.js index 195d098..c4b18b3 100644 --- a/frontend/nuxt.config.js +++ b/frontend/nuxt.config.js @@ -76,7 +76,7 @@ export default { ], server: { host: "0.0.0.0", // default: localhost - port: 3055, // default: 3000 + port: 3158, // default: 3000 }, // Global CSS: https://go.nuxtjs.dev/config-css