-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
executable file
·48 lines (37 loc) · 1.49 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
FROM ekidd/rust-musl-builder:stable as builder
RUN USER=root cargo new --bin rust-gstreamer-rclone
COPY ./rust-webserver ./rust-gstreamer-rclone
WORKDIR ./rust-gstreamer-rclone
RUN cargo build --release
RUN rm -r ./target/x86_64-unknown-linux-musl/release/deps
RUN cargo build --release
FROM docker.io/library/alpine:3.16 AS builder1
COPY ./streaming-service-bridge ./streaming-service-bridge
WORKDIR ./streaming-service-bridge
RUN apk --no-cache add gstreamer-dev gst-plugins-base-dev
RUN apk --no-cache add build-base openssl-dev cargo libnice-dev
RUN cargo build --release -p gst-meet
FROM docker.io/library/alpine:3.16
RUN apk update
RUN apk --no-cache add curl
RUN apk --no-cache add sed
RUN apk add --no-cache --upgrade bash
RUN apk --no-cache add jq
RUN apk --no-cache add unzip
RUN apk --no-cache add gstreamer gst-plugins-good gst-plugins-bad gst-plugins-ugly gst-libav libnice-gstreamer
RUN apk --no-cache add libnice openssl
ARG APP=/usr/src/app
ENV TZ=Etc/UTC \
APP_USER=appuser
RUN addgroup -S $APP_USER \
&& adduser -S -g $APP_USER $APP_USER
RUN apk update \
&& apk add --no-cache ca-certificates tzdata \
&& rm -rf /var/cache/apk/*
COPY --from=builder1 /streaming-service-bridge/target/release/gst-meet /usr/src/app/
COPY --from=builder /home/rust/src/rust-gstreamer-rclone/target/x86_64-unknown-linux-musl/release/rust-gstreamer-rclone ${APP}/rust-gstreamer-rclone
RUN chown -R $APP_USER:$APP_USER ${APP}
USER $APP_USER
WORKDIR ${APP}
EXPOSE 8080
CMD ["./rust-gstreamer-rclone"]