mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-22 14:28:05 +00:00
Docker build
This commit is contained in:
3
.dockerignore
Normal file
3
.dockerignore
Normal file
@ -0,0 +1,3 @@
|
||||
target/
|
||||
.git/
|
||||
out/
|
38
Dockerfile
38
Dockerfile
@ -1,4 +1,36 @@
|
||||
FROM ubuntu:latest
|
||||
LABEL authors="Kieran"
|
||||
ARG IMAGE=rust:bookworm
|
||||
|
||||
ENTRYPOINT ["top", "-b"]
|
||||
FROM $IMAGE as build
|
||||
WORKDIR /app/src
|
||||
ENV FFMPEG_DIR=/app/ffmpeg
|
||||
COPY . .
|
||||
RUN apt update && \
|
||||
apt install -y \
|
||||
build-essential \
|
||||
libx264-dev \
|
||||
nasm \
|
||||
libclang-dev && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN git clone --depth=1 https://git.ffmpeg.org/ffmpeg.git && \
|
||||
cd ffmpeg && \
|
||||
./configure \
|
||||
--prefix=$FFMPEG_DIR \
|
||||
--disable-programs \
|
||||
--disable-doc \
|
||||
--disable-network \
|
||||
--enable-gpl \
|
||||
--enable-version3 \
|
||||
--enable-libx264 \
|
||||
--disable-static \
|
||||
--enable-shared && \
|
||||
make -j8 && make install
|
||||
RUN cargo install --path . --root /app/build
|
||||
|
||||
FROM $IMAGE as runner
|
||||
WORKDIR /app
|
||||
RUN apt update && \
|
||||
apt install -y libx264-164 && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
COPY --from=build /app/build .
|
||||
COPY --from=build /app/ffmpeg/lib/ /lib
|
||||
ENTRYPOINT ["/app/bin/stream-core"]
|
Reference in New Issue
Block a user