From b71a7e04d95c34dabf1b0cccb5b05a62273a29be Mon Sep 17 00:00:00 2001 From: hgw Date: Tue, 10 Oct 2023 11:05:10 +0000 Subject: [PATCH] Vastly optimise Docker image --- Dockerfile | 14 +++++++++++--- docker-compose.yml | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index e025513..0fbd585 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,14 @@ -FROM rust:bookworm -WORKDIR /app +FROM alpine/git:latest as ircie +WORKDIR /ircie RUN git clone https://git.supernets.org/sad/ircie.git + +FROM rust:1-bookworm as builder +WORKDIR /app COPY . . +COPY --from=ircie /ircie/ /app/ RUN cargo build --release -CMD ["./target/release/hardfight"] \ No newline at end of file + +FROM rust:1-bookworm as app +WORKDIR /hardfight +COPY --from=builder /app/target/release/hardfight . +CMD ["./hardfight"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index 1bab296..3a6b8aa 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,7 @@ services: hardfight: + container_name: hardfight image: git.supernets.org/hgw/hardfight:latest #build: . volumes: - - "$PWD/config/:/app/config/" \ No newline at end of file + - "$PWD/config/:/hardfight/config/" \ No newline at end of file