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

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