baalajimaestro
6baac1ac79
All checks were successful
/ Building (push) Successful in 2m52s
Smallest dockerfile possible Signed-off-by: baalajimaestro <me@baalajimaestro.me>
26 lines
685 B
Docker
26 lines
685 B
Docker
FROM rust:alpine as builder
|
|
|
|
RUN apk add musl-dev
|
|
|
|
RUN mkdir /app
|
|
WORKDIR /app
|
|
|
|
ARG RUSTFLAGS="-C target-feature=+crt-static"
|
|
|
|
COPY Cargo.toml /app
|
|
COPY Cargo.lock /app
|
|
COPY src /app/src
|
|
COPY templates /app/templates
|
|
|
|
RUN cargo build --release --target=x86_64-unknown-linux-musl
|
|
|
|
RUN strip -s /app/target/x86_64-unknown-linux-musl/release/paste-frontend && \
|
|
strip -R .comment -R .note -R .note.ABI-tag /app/target/x86_64-unknown-linux-musl/release/paste-frontend
|
|
|
|
FROM scratch
|
|
WORKDIR /app
|
|
COPY --from=builder /app/target/x86_64-unknown-linux-musl/release/paste-frontend /app/paste-frontend
|
|
ADD templates /app/templates
|
|
ADD static /app/static
|
|
EXPOSE 8080
|
|
CMD ["./paste-frontend"]
|