From 5d5d894344520446a79eadbe22a49d16a0c42c05 Mon Sep 17 00:00:00 2001 From: jrtechs Date: Fri, 6 Mar 2026 22:30:21 +0000 Subject: [PATCH] Updated to debian bookworm, added multi-stage build w/ cargo since GIFSKI is not packaged for ARM and we needed to build from source --- Dockerfile | 25 ++++++++++++++++++------- docker-compose.yml | 11 ++++++----- 2 files changed, 24 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index d7c06d4..f735605 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,21 @@ # jeffery russell 12-19-2020 -FROM node:buster-slim +# --- Stage 1: Builder --- +FROM rust:1.75-slim-bookworm AS builder +RUN apt-get update && apt-get install -y gcc \ + && rm -rf /var/lib/apt/lists/* +WORKDIR /app + +# Switch to nightly Rust to support edition2024 +RUN rustup install nightly && rustup default nightly + +# Compile and install the binary +RUN cargo install gifski + +# --- Stage 2: Runtime --- +FROM node:bookworm-slim +# Copy only the built binary from the builder stage +COPY --from=builder /usr/local/cargo/bin/gifski /usr/local/bin/gifski WORKDIR /src/ @@ -8,14 +23,10 @@ COPY package.json package.json RUN ls -la -# installs ffmpeg and gifski v 1.3.3 +# installs ffmpeg RUN apt-get update && \ apt-get install ffmpeg -y && \ - apt-get install wget -y && \ - cd /root && \ - wget https://github.com/jrtechs/static-storage/raw/master/gifski.deb && \ - dpkg -i /root/gifski.deb && \ - rm /root/gifski.deb + apt-get install wget -y # installs node dependencies RUN npm install diff --git a/docker-compose.yml b/docker-compose.yml index 52df9d9..433226d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,9 +1,9 @@ -version: '3.1' - networks: external-network: - external: - name: external-network + external: true + +volumes: + node_modules: services: video: @@ -16,4 +16,5 @@ services: networks: - external-network volumes: - - ./:/src \ No newline at end of file + - ./:/src + - node_modules:/src/node_modules \ No newline at end of file