feat: initial commit - Rust + React URL shortener
CI/CD / lint-and-test (push) Has been cancelled
CI/CD / build-and-push (push) Has been cancelled
CI/CD / deploy (push) Has been cancelled

This commit is contained in:
ZeptaLab Bot
2026-05-31 20:45:50 +00:00
commit ca775da1f1
15 changed files with 808 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
# Build frontend
FROM node:20-alpine AS frontend-build
WORKDIR /app
COPY frontend/package.json frontend/package-lock.json ./
RUN npm ci
COPY frontend/ .
RUN npm run build
# Build Rust backend
FROM rust:1.75 AS rust-builder
WORKDIR /app
COPY Cargo.toml Cargo.lock ./
COPY src/ ./src/
RUN cargo build --release
RUN cp target/release/hello-web /app/hello-web
# Final image
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=rust-builder /app/hello-web /app/hello-web
COPY --from=frontend-build /app/dist /app/frontend/dist
EXPOSE 3000
CMD ["/app/hello-web"]