FROM rust:1.88 AS build
WORKDIR /src
COPY Cargo.toml Cargo.lock ./
COPY crates/ crates/
RUN cargo build --release -p irc-now-paste

FROM registry.access.redhat.com/ubi9-minimal
COPY --from=build /src/target/release/irc-now-paste /usr/local/bin/
COPY crates/paste/templates/ /app/templates/
COPY crates/paste/static/ /app/static/
WORKDIR /app
EXPOSE 8080
CMD ["irc-now-paste"]
