diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2935857 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,13 @@ +FROM node:lts-alpine as build-stage +WORKDIR /app +COPY package*.json ./ +RUN npm install +COPY . . +RUN npm run build + +# tahap produksi +FROM nginx:stable-alpine as production-stage +COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY --from=build-stage /app/nginx.conf /etc/nginx/nginx.conf +EXPOSE 32166 +CMD ["nginx", "-g", "daemon off;"] diff --git a/deployment.yaml b/deployment.yaml new file mode 100644 index 0000000..9943bb6 --- /dev/null +++ b/deployment.yaml @@ -0,0 +1,47 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: apkt-eis +spec: + replicas: 3 + selector: + matchLabels: + app: apkt-eis + template: + metadata: + labels: + app: apkt-eis + spec: + containers: + - name: apkt-eis + image: ghcr.io/defuj/eis + ports: + - containerPort: 80 +--- +apiVersion: v1 +kind: Service +metadata: + name: apkt-eis-nodeport +spec: + selector: + app: apkt-eis + ports: + - protocol: TCP + port: 80 + targetPort: 80 + nodePort: 32166 + type: NodePort +--- +apiVersion: v1 +kind: Service +metadata: + name: apkt-eis-clusterip +spec: + selector: + app: apkt-eis + ports: + - protocol: TCP + port: 32166 + targetPort: 80 + type: ClusterIP + diff --git a/ingress.yaml b/ingress.yaml new file mode 100644 index 0000000..c828dd6 --- /dev/null +++ b/ingress.yaml @@ -0,0 +1,16 @@ +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: apkt-eis-ingress +spec: + rules: + - host: localhost + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: apkt-eis-service + port: + number: 80 diff --git a/nginx.conf b/nginx.conf new file mode 100644 index 0000000..7de4a0c --- /dev/null +++ b/nginx.conf @@ -0,0 +1,77 @@ + +user nginx; +worker_processes auto; + +error_log /var/log/nginx/error.log notice; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + log_format main '$remote_addr - $remote_user [$time_local] "$request" ' + '$status $body_bytes_sent "$http_referer" ' + '"$http_user_agent" "$http_x_forwarded_for"'; + + access_log /var/log/nginx/access.log main; + + sendfile on; + #tcp_nopush on; + + keepalive_timeout 65; + + #gzip on; + + #include /etc/nginx/conf.d/*.conf; + server { + listen 80; + listen [::]:80; + server_name localhost; + + #access_log /var/log/nginx/host.access.log main; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} + } +} diff --git a/package.json b/package.json index bef3368..00866ce 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,7 @@ "dev": "vite --host", "tailwind": "tailwindcss -i ./src/assets/css/tailwind.css -o ./src/assets/css/style.css --watch", "build": "run-p type-check build-only", - "preview": "vite preview", + "preview": "vite preview --host", "test:unit": "vitest", "build-only": "vite build", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", @@ -71,4 +71,4 @@ "vitest": "^0.34.6", "vue-tsc": "^1.6.5" } -} +} \ No newline at end of file diff --git a/service.yaml b/service.yaml new file mode 100644 index 0000000..a8340a9 --- /dev/null +++ b/service.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: Service +metadata: + name: apkt-eis-service +spec: + selector: + app: apkt-eis + ports: + - protocol: TCP + port: 80 + targetPort: 80 + type: LoadBalancer diff --git a/src/views/LoginView.vue b/src/views/LoginView.vue index 16f1669..74e6b72 100644 --- a/src/views/LoginView.vue +++ b/src/views/LoginView.vue @@ -19,7 +19,7 @@ onMounted(() => {
logo -

Login

+

Lebet/Login

Selamat datang kembali