diff --git a/.dockerignore b/.dockerignore index b4f431c8..a0d88f54 100644 --- a/.dockerignore +++ b/.dockerignore @@ -12,3 +12,4 @@ src/cache_buster_data.json browser/target browser/cobertura.xml browser/docs +**/target diff --git a/Dockerfile b/Dockerfile index 12441fcf..5b1b7402 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: 2023 Aravinth Manivannan # # SPDX-License-Identifier: AGPL-3.0-or-later - FROM node:18.0.0 as frontend RUN set -ex; \ apt-get update; \ @@ -21,33 +20,16 @@ COPY Makefile /src/ COPY scripts /src/scripts RUN make frontend -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=cacher /src/db/db-core/target /src/db/db-core/target -#COPY --from=cacher /src/db/db-sqlx-postgres/target /src/db/db-sqlx-postgres/target -#COPY --from=cacher /src/db/db-migrations/target /src/db/db-migrations/target -#COPY --from=cacher /src/utils/cache-bust/target /src/utils/cache-bust/target COPY --from=frontend /src/static/cache/bundle/ /src/static/cache/bundle/ COPY --from=frontend /src/docs/openapi/dist/ /src/docs/openapi/dist/ RUN cargo --version RUN make cache-bust RUN cargo build --release -FROM debian:bullseye as mCaptcha +FROM debian:bookworm as mCaptcha LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha RUN useradd -ms /bin/bash -u 1001 mcaptcha WORKDIR /home/mcaptcha