bin/Dockerfile

16 lines
357 B
Docker
Raw Normal View History

2023-11-27 20:06:32 +00:00
FROM rust:1-alpine AS builder
RUN apk add --no-cache musl-dev
2019-05-22 19:01:41 +00:00
COPY . /sources
WORKDIR /sources
RUN cargo build --release
RUN chown nobody:nogroup /sources/target/release/bin
2019-05-22 19:01:41 +00:00
2023-11-27 20:06:32 +00:00
FROM scratch
COPY --from=builder /sources/target/release/bin /pastebin
2023-11-27 20:06:32 +00:00
COPY --from=builder /etc/passwd /etc/passwd
2019-05-22 19:01:41 +00:00
USER nobody
EXPOSE 8000
2020-07-28 00:23:09 +00:00
ENTRYPOINT ["/pastebin", "0.0.0.0:8000"]