From 76e953f550eb5cb375cbe74f4af4ed95cf1855b8 Mon Sep 17 00:00:00 2001 From: ismailmasseran Date: Tue, 30 Jun 2026 11:01:09 +0800 Subject: [PATCH] DONE: add cicd pipeline separate fe and be, test first on gitea (#1) Co-authored-by: ISMAIL MASSERAN Reviewed-on: https://git.koppkb.com/KoPKB/My-KOPKB/pulls/1 --- docker/Dockerfile | 17 +++++++++++++++++ docker/nginx.conf | 23 +++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/nginx.conf diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..5062238 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,17 @@ +# Stage 1: Build Vue SPA +FROM node:22 AS builder +WORKDIR /app +COPY fe/package*.json fe/pnpm-lock.yaml ./ +RUN npm install -g pnpm && pnpm install --frozen-lockfile +COPY fe/ ./ +ARG VITE_API_BASE_URL=https://api.koppkb.com +ARG VITE_APP_URL=https://anggota.koppkb.com +ENV VITE_API_BASE_URL=$VITE_API_BASE_URL +ENV VITE_APP_URL=$VITE_APP_URL +RUN pnpm run typecheck && pnpm exec vite build --mode=production + +# Stage 2: Serve static files +FROM nginx:1.27-alpine +COPY fe/docker/nginx.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /app/dist /usr/share/nginx/html +EXPOSE 80 diff --git a/docker/nginx.conf b/docker/nginx.conf new file mode 100644 index 0000000..e65b452 --- /dev/null +++ b/docker/nginx.conf @@ -0,0 +1,23 @@ +server { + listen 80; + server_name _; + root /usr/share/nginx/html; + index index.html; + + gzip on; + gzip_types text/plain text/css application/json application/javascript text/xml application/xml; + + location / { + try_files $uri $uri/ /index.html; + } + + location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot)$ { + expires 1y; + add_header Cache-Control "public, immutable"; + try_files $uri =404; + } + + location ~ /\. { + deny all; + } +}