From 8c625b3d529f46134b8f2b9a0e030df34e34bc97 Mon Sep 17 00:00:00 2001 From: BALDO Frederick Date: Fri, 22 Sep 2023 14:41:47 +0200 Subject: [PATCH] Fix app startup on platform --- .env | 2 +- Dockerfile | 3 +-- README.md | 5 +++-- manifests/app-deployment.yaml | 2 +- manifests/service.yaml | 2 +- vue.config.js | 4 ---- 6 files changed, 7 insertions(+), 11 deletions(-) diff --git a/.env b/.env index 94b245d..7465c6c 100644 --- a/.env +++ b/.env @@ -1 +1 @@ -VUE_APP_HOST=http://127.0.0.1:9090/ \ No newline at end of file +VUE_APP_HOST=https://reports-api.snap-ci.ovh/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 3eb691b..076eef1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,8 +2,7 @@ FROM node:17-alpine AS build RUN mkdir -p /app WORKDIR /app COPY . . -RUN npm install -RUN npm run build --mode=production +RUN npm install && npm run build --mode=production FROM nginx:1.18-alpine COPY --from=build /app/dist /usr/share/nginx/html diff --git a/README.md b/README.md index 21cee55..f7addb7 100644 --- a/README.md +++ b/README.md @@ -26,8 +26,9 @@ npm run lint ### Deploy to k8s ```sh -kubectl apply -f manifests/deployment.yaml -kubectl apply -f manifests/service.yaml +kubectl apply -f manifests/deployment.yaml -n snap-report +kubectl apply -f manifests/service.yaml -n snap-report +kubectl apply -f manifests/ingress.yaml -n snap-report ``` ### Customize configuration diff --git a/manifests/app-deployment.yaml b/manifests/app-deployment.yaml index d1d6f62..b94a447 100644 --- a/manifests/app-deployment.yaml +++ b/manifests/app-deployment.yaml @@ -25,4 +25,4 @@ spec: requests: cpu: "100m" ports: - - containerPort: 8080 \ No newline at end of file + - containerPort: 80 \ No newline at end of file diff --git a/manifests/service.yaml b/manifests/service.yaml index d9a6dad..d002526 100644 --- a/manifests/service.yaml +++ b/manifests/service.yaml @@ -11,6 +11,6 @@ spec: # Port Map - name: http port: 80 - targetPort: 8080 + targetPort: 80 protocol: TCP type: ClusterIP \ No newline at end of file diff --git a/vue.config.js b/vue.config.js index 7484812..ac95c57 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,7 +1,3 @@ module.exports = { "transpileDependencies": [], - "publicPath": process.env.NODE_ENV === 'production' - ? '/reports/' - : '/' - }