From 31c542c9c5158f0a45340c97f0e633c3cb70536e Mon Sep 17 00:00:00 2001 From: mykola2312 <49044616+mykola2312@users.noreply.github.com> Date: Sat, 9 Mar 2024 15:19:50 +0200 Subject: [PATCH] add locales to container and caching (tho it doesnt work) --- Dockerfile | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab2beed..4bec7cf 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,12 +6,14 @@ RUN apk add --no-cache musl-dev openssl-dev WORKDIR /usr/src/app RUN USER=root cargo init -COPY ./Cargo.toml . +COPY Cargo.toml . COPY Cargo.lock . COPY src/ ./src -COPY migrations ./migrations +COPY locales/ ./locales/ +COPY migrations/ ./migrations/ -RUN touch src/main.rs && cargo build --release +RUN --mount=type=cache,target=/usr/local/cargo/registry \ + touch src/main.rs && cargo build --release RUN strip target/release/mk-dl-bot # Run @@ -21,13 +23,9 @@ RUN apk add --no-cache libgcc RUN apk add --no-cache ffmpeg python3 py3-pip RUN pip install --break-system-packages yt-dlp -# Those directories are required by bot -RUN mkdir -p /var/lib/mk-dl-bot -RUN mkdir -p /var/log/mk-dl-bot - WORKDIR /app -COPY migrations ./migrations -COPY locales ./locales +COPY migrations/ ./migrations/ +COPY locales/ ./locales/ COPY --from=builder /usr/src/app/target/release/mk-dl-bot . ENTRYPOINT ["/app/mk-dl-bot"] \ No newline at end of file