- K8s manifests: namespace, PVC (local-path 2Gi), deployment, service, ingress - Ingress: repo-vis.oci.euphon.net with Let's Encrypt TLS via traefik - Cross-compile aarch64-unknown-linux-musl for OCI ARM64 host - make deploy: local Docker (x86_64) - make deploy-oci: SCP binary + web dist to OCI, native docker build, k3s import - Dockerfile accepts MUSL_TARGET build arg for multi-arch support
23 lines
525 B
Docker
23 lines
525 B
Docker
# Stage 1: Build frontend
|
|
FROM node:22-slim AS frontend
|
|
WORKDIR /build
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
RUN npm run build
|
|
|
|
# Stage 2: Minimal runtime (binary built locally with musl)
|
|
FROM alpine:3.21
|
|
RUN apk add --no-cache git ca-certificates
|
|
|
|
WORKDIR /app
|
|
ARG MUSL_TARGET=x86_64-unknown-linux-musl
|
|
COPY server/target/${MUSL_TARGET}/release/repo-vis-server ./
|
|
COPY --from=frontend /build/dist ./web/dist/
|
|
|
|
ENV PORT=8080
|
|
ENV FRONTEND_DIR=./web/dist
|
|
EXPOSE 8080
|
|
|
|
CMD ["./repo-vis-server"]
|