fix: Remove Cargo.lock from Dockerfile and add it to git
This commit is contained in:
parent
1e9ca98c92
commit
fe35240e82
1 changed files with 2 additions and 2 deletions
|
|
@ -10,14 +10,14 @@ RUN apt-get update && apt-get install -y \
|
|||
libssl-dev \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy Cargo files first for better caching
|
||||
# Copy Cargo.toml (Cargo.lock is optional for dev)
|
||||
COPY Cargo.toml ./
|
||||
|
||||
# Create dummy main.rs for dependency caching
|
||||
RUN mkdir src && echo 'fn main() {}' > src/main.rs
|
||||
|
||||
# Build dependencies (this layer will be cached)
|
||||
RUN cargo build && rm -rf src
|
||||
RUN cargo build
|
||||
|
||||
# Copy actual source code
|
||||
COPY src ./src
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue