Browse Source

Updated to debian bookworm, added multi-stage build w/ cargo since GIFSKI is not packaged for ARM and we needed to build from source

master
jrtechs 15 hours ago
parent
commit
5d5d894344
2 changed files with 24 additions and 12 deletions
  1. +18
    -7
      Dockerfile
  2. +6
    -5
      docker-compose.yml

+ 18
- 7
Dockerfile View File

@ -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

+ 6
- 5
docker-compose.yml View File

@ -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
- ./:/src
- node_modules:/src/node_modules

Loading…
Cancel
Save