diff --git a/Dockerfile b/Dockerfile index 0e6ad61..ec7813f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,20 +3,14 @@ FROM clux/muslrust:latest AS build COPY Cargo.toml Cargo.lock /volume/ -RUN mkdir -p /volume/src && touch /volume/src/lib.rs +COPY . . RUN cargo fetch --locked RUN cargo build --release -RUN rm -rfv /volume/src/*.rs -COPY . . - RUN rm -rfv /volume/target/*/release/rave -ENV DATABASE_URL='sqlite:/config/users.db' -RUN cargo build --release --features docker - RUN mv target/*-unknown-linux-musl/release/rave /tmp/rave # --- Runtime --- @@ -24,6 +18,14 @@ FROM gcr.io/distroless/static AS runtime COPY --from=build /tmp/rave /rave +WORKDIR /app + +COPY ./static ./static + ENV RUST_LOG=info +ENV RAVE_STORAGE_DIR=/data +ENV RAVE_CACHE_DIR=/cache + +VOLUME [ "/data", "/cache" ] ENTRYPOINT ["/rave"] diff --git a/Justfile b/Justfile index ca2b864..6853221 100644 --- a/Justfile +++ b/Justfile @@ -10,7 +10,7 @@ unmount: bash ./mount-tool.sh unmount run: mount - RAVE_STORAGE_DIR=/home/lys/Programming/fuck RAVE_CACHE_DIR=/tmp/cache-for-rave cargo r + RAVE_STORAGE_DIR=/tmp/media-for-rave RAVE_CACHE_DIR=/tmp/cache-for-rave cargo r refresh: sea migrate fresh