Files
tori/Dockerfile
Fam Zheng eb8f5173f3 Bump Rust image to 1.86 for edition2024 support
getrandom 0.4.1 requires edition2024 which needs Cargo >= 1.85.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-28 10:48:14 +00:00

27 lines
571 B
Docker

# Stage 1: Build frontend
FROM node:22-alpine AS frontend
WORKDIR /app/web
COPY web/package.json web/package-lock.json ./
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
FROM alpine:3.21
RUN apk add --no-cache ca-certificates
WORKDIR /app
COPY --from=backend /app/target/release/tori .
COPY --from=frontend /app/web/dist ./web/dist/
COPY config.yaml .
EXPOSE 3000
CMD ["./tori"]