# Development image. Built by docker-compose.dev.yml. # Debug build; the dev compose mounts ./src:/app/src for rapid rebuilds. FROM rust:latest AS builder WORKDIR /app RUN apt-get update && apt-get install -y \ pkg-config \ libssl-dev \ && rm -rf /var/lib/apt/lists/* # Cache dependency build via a dummy main.rs COPY Cargo.toml ./ RUN mkdir src && echo 'fn main() {}' > src/main.rs RUN cargo build && rm -rf src # Copy actual source and build COPY src ./src RUN cargo build # Runtime stage — full Rust image so the dev compose can rebuild in-container. # curl is required for the compose HEALTHCHECK to work. FROM rust:latest RUN apt-get update && apt-get install -y \ curl \ && rm -rf /var/lib/apt/lists/* WORKDIR /app COPY --from=builder /app/target/debug/normogen-backend /app/normogen-backend # The app listens on NORMOGEN_PORT (default 6500, set in compose/.env). EXPOSE 6500 CMD ["/app/normogen-backend"]