feat: CI/CD workflow, Dockerfile, and K8s deployment
- Multi-stage Dockerfile (Maven + Node build, JRE runtime) - Gitea Actions CI: build → docker → deploy - K8s manifests: Deployment, Service (NodePort 30082), Ingress - ServiceAccount + RBAC for kubectl access from pod - Docker socket mount for image builds - Ingress at deploy.cameleer.siegeln.net - SPA config for serving frontend from Spring Boot - cameleer-demo namespace for deployed apps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
FROM --platform=$BUILDPLATFORM maven:3.9-eclipse-temurin-21 AS backend-build
|
||||
WORKDIR /build
|
||||
COPY pom.xml .
|
||||
RUN mvn dependency:go-offline -B || true
|
||||
COPY src/ src/
|
||||
RUN mvn clean package -DskipTests -B
|
||||
|
||||
FROM --platform=$BUILDPLATFORM node:22-alpine AS ui-build
|
||||
WORKDIR /ui
|
||||
ARG REGISTRY_TOKEN
|
||||
COPY ui/package.json ui/package-lock.json ui/.npmrc ./
|
||||
RUN echo "//gitea.siegeln.net/api/packages/cameleer/npm/:_authToken=${REGISTRY_TOKEN}" >> .npmrc && \
|
||||
npm ci
|
||||
COPY ui/ .
|
||||
RUN npm run build
|
||||
|
||||
FROM eclipse-temurin:21-jre
|
||||
WORKDIR /app
|
||||
COPY --from=backend-build /build/target/cameleer-deploy-demo-*.jar /app/server.jar
|
||||
COPY --from=ui-build /ui/dist /app/static
|
||||
|
||||
EXPOSE 8082
|
||||
ENV TZ=UTC
|
||||
ENTRYPOINT exec java -Duser.timezone=UTC \
|
||||
-Dserver.port=8082 \
|
||||
-Dspring.web.resources.static-locations=file:/app/static/ \
|
||||
-jar /app/server.jar
|
||||
Reference in New Issue
Block a user