From 63b780ac11311f2abf7fafddee1535ff8157e6bd Mon Sep 17 00:00:00 2001 From: icsboyx Date: Tue, 6 Jan 2026 16:33:23 +0100 Subject: [PATCH] Refactor Dockerfile and docker-compose for improved build process and clarity --- Dockerfile | 5 ++++- docker-compose.yaml | 6 +++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index ac0afb7..990f0a2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,5 +20,8 @@ RUN pacman -Syu --noconfirm --needed \ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y ENV PATH="/root/.cargo/bin:${PATH}" +WORKDIR /opt/black_hole_share +RUN cargo build --release && cp ./target/release/black_hole_share /usr/local/bin/black_hole_share && black_hole_share; + WORKDIR /data -CMD cargo build --release && cp ./target/release/black_hole_share /usr/local/bin/black_hole_share && black_hole_share; \ No newline at end of file +CMD [ "black_hole_share" ] \ No newline at end of file diff --git a/docker-compose.yaml b/docker-compose.yaml index d34fa96..84b2d10 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,9 +6,9 @@ services: container_name: black_hole_share volumes: - ./data:/data - - ./src:/data/src - - ./Cargo.lock:/data/Cargo.lock - - ./Cargo.toml:/data/Cargo.toml + - ./src:/opt/bhs + - ./Cargo.lock:/opt/bhs/Cargo.lock + - ./Cargo.toml:/opt/bhs/Cargo.toml - /etc/localtime:/etc/localtime:ro labels: