this repo has no description
1FROM rust
2WORKDIR /app
3
4# copying just cargo config and making a stub main
5# this means docker can cache building deps
6# and just build the main program in watch mode
7# much quicker and nicer on my cpu, network, and ram lol
8COPY ./Cargo.toml ./Cargo.toml
9COPY ./Cargo.lock ./Cargo.lock
10RUN mkdir ./src && echo 'fn main() { println!("Using cache build!!"); loop { println!("DOCKERFILE failed..."); } }' > ./src/main.rs
11RUN cargo build --locked
12RUN rm -f ./target/debug/index
13
14COPY ./src ./src
15COPY ./.sqlx ./.sqlx
16RUN cargo build --locked
17
18RUN cp ./target/debug/index ./index
19CMD ["/app/index"]