cache
Some checks are pending
Build and Push Docker Image / build-and-push (push) Waiting to run

This commit is contained in:
Dmitri 2026-05-03 22:39:22 +02:00
parent adb95de2a9
commit ed7fff4983
Signed by: kanopo
GPG Key ID: 759ADD40E3132AC7
2 changed files with 11 additions and 2 deletions

View File

@ -31,5 +31,5 @@ jobs:
file: ./Dockerfile
push: true
tags: git.kanopo.dev/rhythm/rhythm-backend:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache,mode=max
cache-from: type=gha
cache-to: type=gha,mode=max

View File

@ -1,7 +1,16 @@
FROM rust:1.95.0-alpine3.22 AS builder
WORKDIR /app
# Cache dependencies by building a dummy project first
COPY Cargo.toml Cargo.lock ./
RUN mkdir src && echo "fn main() {}" > src/main.rs
RUN cargo build --release
RUN rm -rf src
# Copy real source code and build
COPY . .
# Touch the main file to ensure cargo sees it as newer than the dummy build
RUN touch src/main.rs
RUN cargo build --release
# Small runtime image