formulate 1.2.0

formulate is a standalone server that listens for web form data submissions.
FROM rust:1.80-alpine3.20 AS builder
WORKDIR /usr/src/formulate

ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse
COPY . .

RUN --mount=type=cache,target=./build/target \
    --mount=type=cache,target=./build/cargo/registry \
    --mount=type=cache,target=./build/cargo/git \
    apk add libc-dev pkgconfig libressl-dev
RUN cargo build --release

FROM alpine:3.20
LABEL dev.orbitsolutions.code="ORB IT Solutions LLC"
LABEL org.opencontainers.image.authors="orbit+maint@orbitsolutions.dev"
LABEL version="1.2"

ENV OPENSMTPD_VER="7.5.0p0"

RUN apk add --no-cache -t opensmtpd-rundeps tzdata \
    "opensmtpd~${OPENSMTPD_VER}"; \
    mkdir -p /var/spool/smtpd && chmod 711 /var/spool/smtpd

COPY --from=builder /usr/src/formulate/target/release/formulate /usr/local/bin/formulate

ENV FORMULATE_destination_email=""
ENV FORMULATE_sending_email=""

EXPOSE 25 8000
CMD ["/bin/sh", "-c", "smtpd -v; formulate"]