Files
hello-web/Dockerfile
T
ZeptaLab Bot ca775da1f1
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
feat: initial commit - Rust + React URL shortener
2026-05-31 20:45:50 +00:00

27 lines
681 B
Docker

# 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"]