add locales to container and caching (tho it doesnt work)

This commit is contained in:
mykola2312 2024-03-09 15:19:50 +02:00
parent 7902e76586
commit 31c542c9c5

View file

@ -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"]