tirocinio-canali-steffo-acrate/acrate_docker/Dockerfile

42 lines
1.6 KiB
Text
Raw Normal View History

FROM rust AS base_builder
WORKDIR /usr/src/acrate
COPY --from=source ./acrate_database ./acrate_database
COPY --from=source ./acrate_nodeinfo ./acrate_nodeinfo
COPY --from=source ./acrate_rd ./acrate_rd
COPY --from=source ./acrate_rdserver ./acrate_rdserver
COPY --from=source ./Cargo.toml ./Cargo.toml
COPY --from=source ./Cargo.lock ./Cargo.lock
FROM rust:slim AS base_runner
RUN apt-get update
RUN apt-get upgrade --assume-yes
RUN apt-get install --assume-yes libpq5
WORKDIR /usr/local/bin
ENV RUST_LOG="warn"
FROM base_builder AS migrate_build
RUN cargo build --release --package=acrate_database --features=bin --bin=acrate_database_migrate
FROM base_runner AS migrate
COPY --from=migrate_build /usr/src/acrate/target/release/acrate_database_migrate /usr/local/bin/acrate_database_migrate
ENTRYPOINT ["acrate_database_migrate"]
ENV RUST_LOG="warn,acrate_database_migrate=info"
FROM base_builder AS rdserver_build
RUN cargo build --release --package=acrate_rdserver --bin=acrate_rdserver
FROM base_runner AS rdserver
COPY --from=rdserver_build /usr/src/acrate/target/release/acrate_rdserver /usr/local/bin/acrate_rdserver
ENTRYPOINT ["acrate_rdserver"]
HEALTHCHECK CMD ["curl", "http://127.0.0.1/.healthcheck"]
ENV RUST_LOG="warn,acrate_rdserver=info"
2024-12-16 01:28:12 +00:00
FROM base_builder AS apub_inbox_build
RUN cargo build --release --package=acrate_apub_inbox --bin=acrate_apub_inbox
FROM base_runner AS apub_inbox
COPY --from=apub_inbox_build /usr/src/acrate/target/release/acrate_apub_inbox /usr/local/bin/acrate_apub_inbox
ENTRYPOINT ["acrate_apub_inbox"]
HEALTHCHECK CMD ["curl", "http://127.0.0.1/.healthcheck"]
ENV RUST_LOG="warn,acrate_apub_inbox=info"