fix: get rid of caching

This commit is contained in:
Aravinth Manivannan 2023-10-16 20:04:19 +05:30
parent f337ee0643
commit e0203c660d
No known key found for this signature in database
GPG key ID: F8F50389936984FF
2 changed files with 2 additions and 19 deletions

View file

@ -12,3 +12,4 @@ src/cache_buster_data.json
browser/target browser/target
browser/cobertura.xml browser/cobertura.xml
browser/docs browser/docs
**/target

View file

@ -1,7 +1,6 @@
# SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net> # SPDX-FileCopyrightText: 2023 Aravinth Manivannan <realaravinth@batsense.net>
# #
# SPDX-License-Identifier: AGPL-3.0-or-later # SPDX-License-Identifier: AGPL-3.0-or-later
FROM node:18.0.0 as frontend FROM node:18.0.0 as frontend
RUN set -ex; \ RUN set -ex; \
apt-get update; \ apt-get update; \
@ -21,33 +20,16 @@ COPY Makefile /src/
COPY scripts /src/scripts COPY scripts /src/scripts
RUN make frontend 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 FROM rust:latest as rust
WORKDIR /src WORKDIR /src
COPY . . 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/static/cache/bundle/ /src/static/cache/bundle/
COPY --from=frontend /src/docs/openapi/dist/ /src/docs/openapi/dist/ COPY --from=frontend /src/docs/openapi/dist/ /src/docs/openapi/dist/
RUN cargo --version RUN cargo --version
RUN make cache-bust RUN make cache-bust
RUN cargo build --release RUN cargo build --release
FROM debian:bullseye as mCaptcha FROM debian:bookworm as mCaptcha
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
RUN useradd -ms /bin/bash -u 1001 mcaptcha RUN useradd -ms /bin/bash -u 1001 mcaptcha
WORKDIR /home/mcaptcha WORKDIR /home/mcaptcha