Compare commits

...

4 commits

Author SHA1 Message Date
fad24597fd
CI: add webhook triggering quay.io 2024-05-26 12:18:17 +02:00
8147ffd231
update alpine to 3.20 2024-05-26 11:47:53 +02:00
5b2d6653dc
add dockerignore 2024-05-26 11:33:42 +02:00
97a7268d4a
fix docker not compiling 2024-05-26 11:33:25 +02:00
3 changed files with 32 additions and 16 deletions

3
.dockerignore Normal file
View file

@ -0,0 +1,3 @@
**/target/
23*/
24*/

View file

@ -0,0 +1,16 @@
name: Trigger quay.io Webhook
on:
push:
jobs:
run:
runs-on: alpine-latest
steps:
- run: |
apk add ca-certificates curl
curl -v -X POST --data '{
"commit": "${{forgejo.sha}}",
"ref": "${{forgejo.ref}}",
"default-branch": "main"
}' 'https://$token:${{secrets.quay_token}}@quay.io/webhooks/push/trigger/48d15dc7-ef9a-45bd-83e6-e1714c73dca6'

View file

@ -1,26 +1,24 @@
FROM alpine:3.19 AS builder FROM alpine:3.20
RUN apk add --no-cache cargo
RUN mkdir /src
COPY . /src
WORKDIR /src
RUN cargo build --release --no-default-features
# ##############################################
FROM alpine:3.19
ARG ffmpeg_ver=7.0 ARG ffmpeg_ver=7.0
RUN mkdir -p /usr/local/src/render_video
COPY LICENSE /usr/local/src/render_video/LICENSE
COPY Cargo.toml /usr/local/src/render_video/Cargo.toml
COPY Cargo.lock /usr/local/src/render_video/Cargo.lock
COPY src /usr/local/src/render_video/src
COPY assets /usr/local/src/render_video/assets
RUN apk add --no-cache \ RUN apk add --no-cache \
dav1d fontconfig freetype harfbuzz librsvg libva lilv-libs opus svt-av1 x264-libs x265 \ dav1d fontconfig freetype harfbuzz librsvg libva lilv-libs opus svt-av1 x264-libs x265 \
font-noto inkscape libarchive-tools libgcc \ font-noto inkscape libarchive-tools libgcc \
# we install ffmpeg ourselves to get libsvtav1 support which is not part of the alpine package \
&& apk add --no-cache --virtual .build-deps \ && apk add --no-cache --virtual .build-deps \
build-base \ build-base cargo pkgconf \
dav1d-dev fontconfig-dev freetype-dev harfbuzz-dev librsvg-dev libva-dev lilv-dev opus-dev svt-av1-dev x264-dev x265-dev \ dav1d-dev fontconfig-dev freetype-dev harfbuzz-dev librsvg-dev libva-dev lilv-dev opus-dev svt-av1-dev x264-dev x265-dev \
# build the render_video project
&& cargo install --path /usr/local/src/render_video --root /usr/local --no-default-features \
&& rm -rf ~/.cargo \
# we install ffmpeg ourselves to get libsvtav1 support which is not part of the alpine package \
&& wget -q https://ffmpeg.org/releases/ffmpeg-${ffmpeg_ver}.tar.bz2 \ && wget -q https://ffmpeg.org/releases/ffmpeg-${ffmpeg_ver}.tar.bz2 \
&& tar xfa ffmpeg-${ffmpeg_ver}.tar.bz2 \ && tar xfa ffmpeg-${ffmpeg_ver}.tar.bz2 \
&& cd ffmpeg-${ffmpeg_ver} \ && cd ffmpeg-${ffmpeg_ver} \
@ -63,6 +61,5 @@ RUN apk add --no-cache \
&& install -Dm644 -t /usr/share/licenses/msfonts/ Licen.TXT \ && install -Dm644 -t /usr/share/licenses/msfonts/ Licen.TXT \
&& cd .. \ && cd .. \
&& rm -r msfonts webfonts.tar.gz && rm -r msfonts webfonts.tar.gz
COPY --from=builder /src/target/release/render_video /usr/local/bin/render_video
ENTRYPOINT ["/usr/local/bin/render_video"] ENTRYPOINT ["/usr/local/bin/render_video"]