From 2e92761d115d1c1b700be2f4a2c937bcedb09be0 Mon Sep 17 00:00:00 2001 From: SevenOfAces Date: Mon, 18 Nov 2024 19:41:43 -0800 Subject: [PATCH] Kubernetes! --- Dockerfile | 11 ++++-- deployment.yaml | 40 +++++++++++++++++++++ src/App.vue | 2 +- src/components/__tests__/HelloWorld.spec.ts | 11 ------ 4 files changed, 50 insertions(+), 14 deletions(-) create mode 100644 deployment.yaml delete mode 100755 src/components/__tests__/HelloWorld.spec.ts diff --git a/Dockerfile b/Dockerfile index e0f1154..aec55c2 100755 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,13 @@ -FROM node:latest as build-stage +# build stage +FROM node:lts-alpine as build-stage WORKDIR /app COPY package*.json ./ RUN npm install -COPY ./ . +COPY . . RUN npm run build + +# production stage +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html +EXPOSE 80 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..a081f45 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,40 @@ +kind: Deployment +apiVersion: apps/v1 +metadata: + name: smgames-club + namespace: smgames-club +spec: + replicas: 1 + selector: + matchLabels: + k8s-app: smgames-club + template: + metadata: + name: smgames-club + creationTimestamp: null + labels: + k8s-app: smgames-club + spec: + containers: + - name: smgames-club + image: git.smgames.club/mad-star-studio/hubsite:latest + resources: {} + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File + imagePullPolicy: Always + securityContext: + privileged: false + restartPolicy: Always + terminationGracePeriodSeconds: 30 + dnsPolicy: ClusterFirst + securityContext: {} + imagePullSecrets: + - name: forgejo-access + schedulerName: default-scheduler + strategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: 25% + maxSurge: 25% + revisionHistoryLimit: 10 + progressDeadlineSeconds: 600 \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index fdafb05..77523bd 100755 --- a/src/App.vue +++ b/src/App.vue @@ -40,7 +40,7 @@ const changeTheme = (newTheme: string) => {