From 63eefef310750914f399c3060ac2fde5a355b45a Mon Sep 17 00:00:00 2001 From: Vann-Dev Date: Sat, 16 Dec 2023 09:45:53 +0700 Subject: [PATCH] fix: docker file --- .github/workflows/docker-image.yml | 11 +++++++++++ Dockerfile | 9 +-------- 2 files changed, 12 insertions(+), 8 deletions(-) create mode 100644 .github/workflows/docker-image.yml diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..14b72a3 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,11 @@ +name: Build and Push Docker Image +on: + push: + branches: + - main + - development + +jobs: + build: + uses: VannApps/workflows/.github/workflows/build-and-push-docker-image.yml@main + secrets: inherit \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 509b431..a725300 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,10 @@ FROM rust:1.74.1-slim-bookworm as build -RUN USER=root cargo new --bin image-proxy -WORKDIR /image-proxy +WORKDIR /tmp/build COPY ./Cargo.lock ./Cargo.lock COPY ./Cargo.toml ./Cargo.toml -RUN cargo build --release -RUN rm src/*.rs - -COPY ./src ./src - -RUN rm ./target/release/deps/image-proxy* RUN cargo build --release FROM rust:1.74.1-slim-bookworm