Add dockerfile
Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
parent
4fbee48847
commit
99cd30aa7e
3 changed files with 27 additions and 0 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
@ -0,0 +1 @@
|
||||||
|
target/
|
|
@ -3,6 +3,14 @@ name = "paste-frontend"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
||||||
|
[profile.release]
|
||||||
|
opt-level = 3
|
||||||
|
lto = true
|
||||||
|
|
||||||
|
[[bin]]
|
||||||
|
name="paste-frontend"
|
||||||
|
path = "src/main.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
actix-web = "4"
|
actix-web = "4"
|
||||||
tera = "1.17.1"
|
tera = "1.17.1"
|
||||||
|
|
18
Dockerfile
Normal file
18
Dockerfile
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
FROM rust:alpine as builder
|
||||||
|
|
||||||
|
RUN mkdir /app
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk update && apk add openssl-dev musl-dev
|
||||||
|
|
||||||
|
COPY Cargo.toml /app
|
||||||
|
COPY Cargo.lock /app
|
||||||
|
RUN cargo update
|
||||||
|
|
||||||
|
COPY src /app/src
|
||||||
|
COPY templates /app/templates
|
||||||
|
RUN cargo build --release --target x86_64-unknown-linux-musl
|
||||||
|
|
||||||
|
FROM scratch
|
||||||
|
COPY --from=builder /app/target/release/paste-frontend /
|
||||||
|
CMD ["./paste-frontend"]
|
Loading…
Reference in a new issue