Files
ismailmasseran 1cc3351ca6
Build Docker Image / build-backend (push) Successful in 51s
Build Docker Image / build-frontend (push) Successful in 21s
DONE: renaming the frontend url to mykopkb (#7)
Co-authored-by: ISMAIL MASSERAN <topaz@ISMAILs-Macbook.local>
Reviewed-on: #7
2026-07-06 15:56:28 +08:00

28 lines
873 B
Docker

# Stage 1: Build Vue SPA
FROM node:22 AS builder
WORKDIR /app
COPY fe/package*.json fe/pnpm-lock.yaml fe/.npmrc ./
# Skip prepare (cypress install); rebuild esbuild only — required for Vite
RUN npm install -g pnpm && \
pnpm install --frozen-lockfile --ignore-scripts && \
pnpm rebuild esbuild
COPY fe/ ./
ARG VITE_APP_NAME="MyKOPKB"
ARG VITE_APP_VERSION="1.0"
ARG VITE_API_BASE_URL=https://api.koppkb.com
ARG VITE_APP_URL=https://mykopkb.com
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
ENV VITE_APP_URL=$VITE_APP_URL
ENV VITE_APP_NAME=$VITE_APP_NAME
ENV VITE_APP_VERSION=$VITE_APP_VERSION
# RUN pnpm run typecheck # uncomment this to run typecheck
RUN 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