Containerfile and compose

This commit is contained in:
2025-09-20 13:59:25 +02:00
parent a69b8a9c55
commit 9017888794
4 changed files with 42 additions and 2 deletions

27
Containerfile Normal file
View File

@ -0,0 +1,27 @@
# Use a Rust base image with Cargo installed
FROM rust:1.90 AS builder
LABEL authors="Martin Berg Alstad"
# Set the working directory inside the container
WORKDIR /usr/src/app
# Now copy the source code
COPY Cargo.toml Cargo.lock ./
COPY ./src ./src
# Build your application
RUN cargo build --release
# Start a new stage to create a smaller image without unnecessary build dependencies
FROM debian:trixie-slim
# Set the working directory
WORKDIR /usr/src/app
# Copy the built binary from the previous stage
COPY --from=builder /usr/src/app/target/release/recurring-event-api ./
EXPOSE 8000
# Command to run the application
ENTRYPOINT ["./recurring-event-api"]