add Dockerfile
This commit is contained in:
10
Dockerfile
Normal file
10
Dockerfile
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
FROM rust:latest as build
|
||||||
|
WORKDIR /usr/src/app
|
||||||
|
COPY Cargo.toml Cargo.lock secret.txt postgres_password.txt .
|
||||||
|
COPY src src
|
||||||
|
RUN rustup target add x86_64-unknown-linux-musl
|
||||||
|
RUN cargo build --target=x86_64-unknown-linux-musl --release
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=build /usr/src/app/target/x86_64-unknown-linux-musl/release/shortener /
|
||||||
|
CMD ["/shortener"]
|
||||||
Reference in New Issue
Block a user