Add docker build
This commit is contained in:
parent
5c76842858
commit
82906adca2
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
Dockerfile
|
||||||
|
target/
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,3 +1,2 @@
|
|||||||
/target
|
/target
|
||||||
Cargo.lock
|
|
||||||
config.toml
|
config.toml
|
2000
Cargo.lock
generated
Normal file
2000
Cargo.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
FROM rust:slim as builder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y libssl-dev pkg-config
|
||||||
|
# build deps only first for build cache
|
||||||
|
WORKDIR /usr/src
|
||||||
|
RUN USER=root cargo new chimemon
|
||||||
|
COPY Cargo.toml Cargo.lock /usr/src/chimemon/
|
||||||
|
WORKDIR /usr/src/chimemon
|
||||||
|
RUN cargo build --release
|
||||||
|
COPY . .
|
||||||
|
RUN cargo build --release
|
||||||
|
|
||||||
|
FROM debian:bullseye-slim
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /usr/src/chimemon/target/release/chimemon chimemon
|
||||||
|
CMD ["/app/chimemon"]
|
Loading…
Reference in New Issue
Block a user