From 85ab93798b9f258e6e72786739dd9d4031b9f097 Mon Sep 17 00:00:00 2001 From: Fam Zheng Date: Sat, 28 Feb 2026 10:51:14 +0000 Subject: [PATCH] Simplify Dockerfile to use pre-built musl binary, add Ingress - Dockerfile: drop Rust build stage, COPY static musl binary directly - Add traefik Ingress for tori.oci.euphon.net with LE cert Co-Authored-By: Claude Opus 4.6 --- Dockerfile | 12 ++---------- deploy/deployment.yaml | 24 ++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 10 deletions(-) diff --git a/Dockerfile b/Dockerfile index a21968f..85e2d5d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,19 +6,11 @@ RUN npm ci COPY web/ ./ RUN npm run build -# Stage 2: Build backend -FROM rust:1.86-alpine AS backend -RUN apk add --no-cache musl-dev -WORKDIR /app -COPY Cargo.toml Cargo.lock ./ -COPY src/ ./src/ -RUN cargo build --release - -# Stage 3: Runtime +# Stage 2: Runtime FROM alpine:3.21 RUN apk add --no-cache ca-certificates WORKDIR /app -COPY --from=backend /app/target/release/tori . +COPY target/aarch64-unknown-linux-musl/release/tori . COPY --from=frontend /app/web/dist ./web/dist/ COPY config.yaml . diff --git a/deploy/deployment.yaml b/deploy/deployment.yaml index a38b004..26c5bfe 100644 --- a/deploy/deployment.yaml +++ b/deploy/deployment.yaml @@ -59,3 +59,27 @@ spec: - port: 80 targetPort: 3000 type: ClusterIP +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: tori + namespace: tori + annotations: + traefik.ingress.kubernetes.io/router.tls.certresolver: le +spec: + ingressClassName: traefik + rules: + - host: tori.oci.euphon.net + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: tori + port: + number: 80 + tls: + - hosts: + - tori.oci.euphon.net