Skip to content

Commit 253c0ff

Browse files
authored
chore(docker): build dependency cache (#366)
1 parent 712f231 commit 253c0ff

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Dockerfile

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,18 @@ RUN apt-get update && apt-get install -y protobuf-compiler libclang-dev
99

1010
WORKDIR /ebills
1111

12+
# start - build dependency cache
13+
RUN mkdir ./src
14+
RUN echo 'fn main() { panic!("Dummy Image Called!")}' > ./src/main.rs
15+
COPY ["Cargo.toml", "Cargo.lock", "./"]
16+
RUN cargo build --release
17+
# end - build dependency cache
18+
1219
COPY ./ .
1320

14-
RUN cargo build --release --features embedded-db
21+
# need to break the cargo cache
22+
RUN touch -a -m ./src/main.rs
23+
RUN cargo build --release --features embedded-db
1524

1625
##############################
1726
## Create image

0 commit comments

Comments
 (0)