Add dockerfile

Signed-off-by: baalajimaestro <me@baalajimaestro.me>
This commit is contained in:
baalajimaestro 2022-12-11 21:03:16 +05:30
parent 4fbee48847
commit 99cd30aa7e
Signed by: baalajimaestro
GPG key ID: F93C394FE9BBAFD5
3 changed files with 27 additions and 0 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
target/

View file

@ -3,6 +3,14 @@ name = "paste-frontend"
version = "0.1.0"
edition = "2021"
[profile.release]
opt-level = 3
lto = true
[[bin]]
name="paste-frontend"
path = "src/main.rs"
[dependencies]
actix-web = "4"
tera = "1.17.1"

18
Dockerfile Normal file
View 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"]