added caddy
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
# ── Build ───────────────────────────────────────────────────
|
||||
FROM rust:1-bookworm AS build
|
||||
WORKDIR /app
|
||||
|
||||
# Cache deps: copy manifests, build a stub, then the real source.
|
||||
COPY Cargo.toml Cargo.lock ./
|
||||
RUN mkdir src && echo "fn main() {}" > src/main.rs \
|
||||
&& cargo build --release \
|
||||
&& rm -rf src
|
||||
|
||||
COPY . .
|
||||
# Touch so cargo rebuilds with the real main.rs.
|
||||
RUN touch src/main.rs && cargo build --release
|
||||
|
||||
# ── Runtime ─────────────────────────────────────────────────
|
||||
FROM debian:bookworm-slim AS runtime
|
||||
WORKDIR /app
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /app/target/release/shoplist-backend /usr/local/bin/shoplist-backend
|
||||
EXPOSE 8080
|
||||
CMD ["shoplist-backend"]
|
||||
Reference in New Issue
Block a user