2023-10-16 01:36:01 +02:00
|
|
|
FROM rust
|
2023-10-16 01:35:05 +02:00
|
|
|
|
2023-10-16 01:36:01 +02:00
|
|
|
WORKDIR /usr/src/app
|
|
|
|
|
|
|
|
# first cargo files to cache dependencies
|
2023-10-16 01:36:02 +02:00
|
|
|
COPY Cargo.toml ./
|
2023-10-16 01:36:01 +02:00
|
|
|
RUN mkdir src && \
|
|
|
|
echo "fn main() {println!(\"if you see this, the build broke\")}" > src/main.rs && \
|
|
|
|
cargo build --release
|
|
|
|
RUN rm -rf src target/release/deps/ixvd_web*
|
|
|
|
|
|
|
|
COPY . .
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
EXPOSE 8080
|
|
|
|
CMD ["./target/release/ixvd-web"]
|