forms/Dockerfile

32 lines
991 B
Text
Raw Normal View History

2022-09-07 13:06:03 +05:30
FROM rust:latest as planner
RUN cargo install cargo-chef
WORKDIR /src
COPY . /src/
RUN cargo chef prepare --recipe-path recipe.json
FROM rust:latest as cacher
WORKDIR /src/
RUN cargo install cargo-chef
COPY --from=planner /src/recipe.json recipe.json
RUN cargo chef cook --release --recipe-path recipe.json
FROM rust:latest as rust
WORKDIR /src
COPY . .
COPY --from=cacher /src/target target
#COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/
RUN cargo --version
#RUN make cache-bust
RUN cargo build --release
FROM debian:bullseye as forms
2022-09-08 18:00:35 +05:30
LABEL org.opencontainers.image.source https://git.batsense.net/librepages/forms
2022-09-07 13:06:03 +05:30
RUN apt-get update && apt-get install -y ca-certificates
RUN useradd -ms /bin/bash -u 1001 forms
WORKDIR /home/forms
COPY --from=rust /src/target/release/forms /usr/local/bin/
#COPY --from=rust /src/config/default.toml /etc/forms/config.toml
RUN mkdir /var/lib/forms && chown forms:forms /var/lib/forms
USER forms
CMD [ "/usr/local/bin/forms" ]