From bde8cc6514003f5c135b791912a52c9b584092cd Mon Sep 17 00:00:00 2001 From: Johannes Heuel Date: Wed, 5 Jun 2024 19:55:40 +0200 Subject: [PATCH] remove caching of rust environment --- Dockerfile | 12 ++---------- docker-compose.yml | 8 ++------ 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0e74725..008c07c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,16 +6,8 @@ RUN apt-get update && apt-get install -y \ WORKDIR "/app" -# Cache cargo build dependencies by creating a dummy source -RUN mkdir src -RUN echo "fn main() {}" > src/main.rs -COPY Cargo.toml ./ -COPY Cargo.lock ./ -RUN cargo build --release --locked -RUN rm /app/target/release/ohrwurm - COPY . . -RUN cargo build --release --locked && cp /app/target/release/ohrwurm /ohrwurm +RUN cargo build --release --locked # Release image FROM debian:bullseye-slim @@ -23,6 +15,6 @@ FROM debian:bullseye-slim RUN apt-get update && apt-get install -y python3-pip ffmpeg RUN pip install -U yt-dlp -COPY --from=build /ohrwurm . +COPY --from=build /app/target/release/ohrwurm . CMD ["./ohrwurm"] diff --git a/docker-compose.yml b/docker-compose.yml index dbbca45..bc5e180 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,12 +1,8 @@ --- -version: "2.1" services: ohrwurm: build: . container_name: ohrwurm restart: unless-stopped - environment: - - DISCORD_TOKEN=${DISCORD_TOKEN} - - DISCORD_APP_ID=${DISCORD_APP_ID} - - ADMIN=${ADMIN} - - RUST_LOG=info + env_file: + - .env