-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d2076ea
commit 5b18cf7
Showing
14 changed files
with
107 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
.vscode/ | ||
node_modules/ | ||
.env* | ||
Dockerfile | ||
**/Dockerfile | ||
**/.dockerignore | ||
**/.gitignore | ||
.git/ | ||
**/*.dockerfile | ||
dev/ | ||
.dockerignore | ||
target/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
set -ex | ||
|
||
apt-get update | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
curl \ | ||
ca-certificates | ||
|
||
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --profile minimal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -251,5 +251,4 @@ default = [ | |
"http", | ||
"http-tls", | ||
"http2", | ||
# "http3", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
FROM bitnami/minideb as builder | ||
|
||
WORKDIR /tmp | ||
|
||
ENV CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH | ||
|
||
RUN --mount=type=bind,src=docker/ffmpeg.sh,dst=/mount/ffmpeg.sh \ | ||
/mount/ffmpeg.sh | ||
|
||
RUN --mount=type=bind,src=docker/rust.sh,dst=/mount/rust.sh \ | ||
/mount/rust.sh | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
libclang-dev \ | ||
protobuf-compiler \ | ||
patchelf | ||
|
||
COPY . . | ||
|
||
ARG PROFILE=release-fat | ||
|
||
RUN cargo build --profile ${PROFILE} --bin scuffle-image-processor -p scuffle-image-processor --locked | ||
|
||
RUN mkdir /out && \ | ||
mv target/${PROFILE}/scuffle-image-processor /out/image-processor && \ | ||
ldd /out/image-processor | grep -o '/[^ ]*' | xargs -I '{}' cp {} /out && \ | ||
patchelf --set-rpath '$ORIGIN' /out/image-processor | ||
|
||
FROM gcr.io/distroless/base-nossl-debian12 | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/scuffletv/scuffle | ||
LABEL org.opencontainers.image.description="Scuffle Image Processor" | ||
LABEL org.opencontainers.image.licenses=BSD-4-Clause | ||
|
||
WORKDIR /app | ||
|
||
ENV LD_LIBRARY_PATH=/app:$LD_LIBRARY_PATH | ||
|
||
COPY --from=builder /out /app | ||
|
||
STOPSIGNAL SIGTERM | ||
|
||
USER 1000 | ||
|
||
ENTRYPOINT ["/app/image-processor"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
pub async fn true_bind(addr: std::net::SocketAddr) -> std::io::Result<std::net::SocketAddr> { | ||
if addr.port() == 0 { | ||
let bind = tokio::net::TcpListener::bind(addr).await?; | ||
bind.local_addr() | ||
} else { | ||
Ok(addr) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters