jrottenberg / ffmpeg

Docker build for FFmpeg on Ubuntu / Alpine / Centos / Scratch / nvidia / vaapi
https://hub.docker.com/r/jrottenberg/ffmpeg/
Apache License 2.0
1.42k stars 454 forks source link

How to have a nodeJs running on top of the jrottenberg image? #363

Open geosigno opened 1 year ago

geosigno commented 1 year ago

I would need to have my nodejs app runing on top of the jrottenberg image.

Here my docker file:

FROM node:18-alpine as builder

WORKDIR /usr/src/app

COPY package.json yarn.lock ./

RUN yarn install --frozen-lockfile

COPY . .

RUN yarn build

FROM jrottenberg/ffmpeg:4.4-nvidia AS FFmpeg

RUN chown root:root -R /usr/local

FROM node:18-alpine

COPY --from=FFmpeg /usr/local /usr/local

WORKDIR /usr/src/app

ENV PATH="${PATH}:/usr/local/bin"

COPY package.json yarn.lock ./

RUN yarn install --production --frozen-lockfile

COPY --from=builder /usr/src/app/dist ./dist

EXPOSE 4343

CMD [ "node", "dist/index.js" ]

The image is correctly built but I got this error on my nodejs app

Error: spawn /usr/local/bin/ffprobe ENOENT

The ffprobe binary is in /usr/local/bin/. The PATH includes "/usr/local/bin/".

Even when doing /usr/local/bin/ffprobe [arguments] directly from my VM it doesn't work.

I don't know what else to check..

ysle commented 7 months ago

got it as :

FROM jrottenberg/ffmpeg:6-alpine AS ffmpeg
FROM node:18-alpine
COPY --from=ffmpeg / /

# + ... npm ci etc
douglasg14b commented 2 months ago

This seems to mess up the users & groups for the image. node:node is not available.