feat: adjusted Dockerfile
This commit is contained in:
parent
fac22a2806
commit
78a1b8fad7
2 changed files with 10 additions and 8 deletions
16
Dockerfile
16
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"]
|
||||
|
|
|
|||
2
Justfile
2
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
|
||||
|
|
|
|||
Loading…
Reference in a new issue