From f4d8e01841b0f49dcd8d0f2d5ae5bf6040dfec5d Mon Sep 17 00:00:00 2001 From: Kavin <20838718+FireMasterK@users.noreply.github.com> Date: Tue, 25 Oct 2022 10:19:41 +0100 Subject: [PATCH] Build application outside docker for ci. --- .github/workflows/build-docker.yml | 5 ++++- Dockerfile.ci | 16 ++++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Dockerfile.ci diff --git a/.github/workflows/build-docker.yml b/.github/workflows/build-docker.yml index d06eb97..df76114 100644 --- a/.github/workflows/build-docker.yml +++ b/.github/workflows/build-docker.yml @@ -12,6 +12,9 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Build Cargo + run: cargo build --release && mv target/release/sponsorblock-mirror . - name: Set up QEMU uses: docker/setup-qemu-action@v2 with: @@ -30,7 +33,7 @@ jobs: uses: docker/build-push-action@v3 with: context: . - file: ./Dockerfile + file: ./Dockerfile.ci platforms: linux/amd64 push: true tags: 1337kavin/sponsorblock-mirror:latest diff --git a/Dockerfile.ci b/Dockerfile.ci new file mode 100644 index 0000000..9917948 --- /dev/null +++ b/Dockerfile.ci @@ -0,0 +1,16 @@ +FROM debian:stable-slim + +RUN --mount=type=cache,target=/var/cache/apt \ + apt-get update && \ + apt-get install -y --no-install-recommends \ + libssl1.1 libpq5 ca-certificates && \ + rm -rf /var/lib/apt/lists/* + +WORKDIR /app/ + +COPY ./sponsorblock-mirror . +COPY ./Rocket.toml . + +EXPOSE 8000 + +CMD ["/app/sponsorblock-mirror"]