File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1.7-labs
1
2
FROM rust:1.77-buster
2
3
3
- COPY Cargo.toml /app/Cargo.toml
4
- COPY Cargo.lock /app/Cargo.lock
4
+ WORKDIR /app
5
5
6
- RUN mkdir /app/src
7
- RUN echo 'fn main() { println!("Hello World!"); }' > /app/src/main.rs
6
+ # .git & README.md are unique per-repository. We ignore them on first copy to prevent cache misses
7
+ COPY --exclude=.git --exclude=README.md . /app
8
8
9
- WORKDIR /app
10
9
RUN cargo build --release --target-dir=/tmp/codecrafters-http-server-target
11
-
12
10
RUN cargo clean -p http-server-starter-rust --release --target-dir=/tmp/codecrafters-http-server-target
13
11
14
- RUN rm -rf /app/src
15
-
16
12
RUN echo "cd \$ {CODECRAFTERS_SUBMISSION_DIR} && cargo build --release --target-dir=/tmp/codecrafters-http-server-target --manifest-path Cargo.toml" > /codecrafters-precompile.sh
17
13
RUN chmod +x /codecrafters-precompile.sh
18
14
19
15
ENV CODECRAFTERS_DEPENDENCY_FILE_PATHS="Cargo.toml,Cargo.lock"
20
16
17
+ # Once the heavy steps are done, we can copy all files back
18
+ COPY . /app
You can’t perform that action at this time.
0 commit comments