route96/Dockerfile

54 lines
1.4 KiB
Docker
Raw Permalink Normal View History

2024-04-30 22:43:40 +01:00
ARG IMAGE=rust:bookworm
2024-11-12 09:52:32 +00:00
ARG FEATURES
2024-04-30 22:43:40 +01:00
2024-11-12 10:38:22 +00:00
FROM $IMAGE AS build
2024-04-30 22:43:40 +01:00
WORKDIR /app/src
2024-09-24 13:49:17 +01:00
COPY src src
COPY migrations migrations
COPY Cargo.lock Cargo.lock
COPY Cargo.toml Cargo.toml
2024-05-10 11:54:40 +01:00
ENV FFMPEG_DIR=/app/ffmpeg
RUN apt update && \
apt install -y \
build-essential \
libx264-dev \
libwebp-dev \
2024-05-13 12:21:22 +01:00
libvpx-dev \
2024-05-10 11:54:40 +01:00
nasm \
libclang-dev && \
rm -rf /var/lib/apt/lists/*
2024-11-12 09:52:32 +00:00
RUN git clone --single-branch --branch release/7.1 https://git.v0l.io/ffmpeg/FFmpeg.git && \
2024-05-29 15:03:47 +01:00
cd FFmpeg && \
2024-05-10 11:54:40 +01:00
./configure \
2024-11-12 09:52:32 +00:00
--prefix=${FFMPEG_DIR} \
2024-05-10 11:54:40 +01:00
--disable-programs \
--disable-doc \
--disable-network \
--enable-gpl \
--enable-libx264 \
--enable-libwebp \
2024-05-13 12:21:22 +01:00
--enable-libvpx \
2024-05-10 11:54:40 +01:00
--disable-static \
2024-11-12 09:52:32 +00:00
--disable-postproc \
2024-05-10 11:54:40 +01:00
--enable-shared && \
2024-11-12 09:52:32 +00:00
make -j$(nproc) install
RUN cargo install --path . --root /app/build --features "${FEATURES}"
2024-04-30 22:43:40 +01:00
2024-11-12 10:38:22 +00:00
FROM node:bookworm AS ui_builder
2024-09-24 13:49:17 +01:00
WORKDIR /app/src
COPY ui_src .
RUN yarn && yarn build
2024-11-12 10:38:22 +00:00
FROM $IMAGE AS runner
2024-12-11 11:49:27 +00:00
LABEL org.opencontainers.image.source="https://git.v0l.io/Kieran/route96"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.authors="Kieran"
2024-04-30 22:43:40 +01:00
WORKDIR /app
2024-05-10 11:54:40 +01:00
RUN apt update && \
2024-05-14 10:15:39 +01:00
apt install -y libx264-164 libwebp7 libvpx7 && \
2024-05-10 11:54:40 +01:00
rm -rf /var/lib/apt/lists/*
2024-04-30 22:43:40 +01:00
COPY --from=build /app/build .
2024-09-24 13:49:17 +01:00
COPY --from=ui_builder /app/src/dist ui
2024-05-10 11:54:40 +01:00
COPY --from=build /app/ffmpeg/lib/ /lib
2024-11-12 10:38:22 +00:00
RUN ./bin/route96 --version
2024-09-22 14:26:23 +01:00
ENTRYPOINT ["./bin/route96"]