-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
33 lines (21 loc) · 804 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
FROM rust:1.82 as builder
WORKDIR /volume
RUN apt-get update && \
apt-get install -y --no-install-recommends musl-tools && \
rustup target add x86_64-unknown-linux-musl && \
cargo init --bin
COPY Cargo.lock Cargo.toml ./
RUN cargo build --release --target x86_64-unknown-linux-musl
COPY assets/ assets/
COPY src/ src/
COPY templates/ templates/
RUN touch src/main.rs && cargo build --release --target x86_64-unknown-linux-musl
FROM alpine:3 as newuser
RUN echo "findstream:x:1000:" > /tmp/group && \
echo "findstream:x:1000:1000::/dev/null:/sbin/nologin" > /tmp/passwd
FROM scratch
COPY --from=builder /volume/target/x86_64-unknown-linux-musl/release/findstream /bin/
COPY --from=newuser /tmp/group /tmp/passwd /etc/
EXPOSE 8080
USER findstream
ENTRYPOINT ["/bin/findstream"]