route96/Dockerfile

50 lines
1.2 KiB
Docker
Raw Permalink Normal View History

2024-04-30 21:43:40 +00:00
ARG IMAGE=rust:bookworm
2024-09-29 11:58:17 +00:00
ARG FEATURES=labels
2024-04-30 21:43:40 +00:00
FROM $IMAGE as build
WORKDIR /app/src
2024-09-24 12:49:17 +00:00
COPY src src
COPY migrations migrations
COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml
2024-05-10 10:54:40 +00:00
ENV FFMPEG_DIR=/app/ffmpeg
RUN apt update && \
apt install -y \
build-essential \
libx264-dev \
libwebp-dev \
2024-05-13 11:21:22 +00:00
libvpx-dev \
2024-05-10 10:54:40 +00:00
nasm \
libclang-dev && \
rm -rf /var/lib/apt/lists/*
2024-05-29 14:02:14 +00:00
RUN git clone --depth=1 https://git.v0l.io/Kieran/FFmpeg.git && \
2024-05-29 14:03:47 +00:00
cd FFmpeg && \
2024-05-10 10:54:40 +00:00
./configure \
--prefix=$FFMPEG_DIR \
--disable-programs \
--disable-doc \
--disable-network \
--enable-gpl \
--enable-version3 \
--enable-libx264 \
--enable-libwebp \
2024-05-13 11:21:22 +00:00
--enable-libvpx \
2024-05-10 10:54:40 +00:00
--disable-static \
--enable-shared && \
make -j8 && make install
2024-10-15 11:29:43 +00:00
RUN cargo install --path . --root /app/build --all-features
2024-04-30 21:43:40 +00:00
2024-09-24 12:49:17 +00:00
FROM node:bookworm as ui_builder
WORKDIR /app/src
COPY ui_src .
RUN yarn && yarn build
2024-04-30 21:43:40 +00:00
FROM $IMAGE as runner
WORKDIR /app
2024-05-10 10:54:40 +00:00
RUN apt update && \
2024-05-14 09:15:39 +00:00
apt install -y libx264-164 libwebp7 libvpx7 && \
2024-05-10 10:54:40 +00:00
rm -rf /var/lib/apt/lists/*
2024-04-30 21:43:40 +00:00
COPY --from=build /app/build .
2024-09-24 12:49:17 +00:00
COPY --from=ui_builder /app/src/dist ui
2024-05-10 10:54:40 +00:00
COPY --from=build /app/ffmpeg/lib/ /lib
2024-09-22 13:26:23 +00:00
ENTRYPOINT ["./bin/route96"]