streamio-ffmpegを使ったRailsAPIをGAEでデプロイ[Ruby][GCP][Docker]
streamio-ffmpeg(gem)を使ったRails製APIを、Google App Engineでデプロイしようとしたら以下のエラーが発生した。
Errno::ENOENT (No such file or directory - the ffprobe binary could not be found in /app/vendor/bundle/ruby/2.6.0/bin:/opt/rbenv/versions/2.6.3/bin:/opt/rbenv/libexec:/opt/rbenv/plugins/ruby-build/bin:/opt/nodejs/bin:/opt/rbenv/shims:/opt/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin):
Dockerを使ってffmpegをインストールする必要があるらしい。 qiita.com
いろいろと試行錯誤してうまくいったDockerfileがこちら。
FROM ruby:2.6.3 WORKDIR /app COPY . /app ENV RACK_ENV=production \ RAILS_ENV=production EXPOSE 8080 ENV PORT=8080 RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y \ libav-tools gpac \ && \ apt-get clean && \ rm -rf /var/lib/apt/lists/ RUN bundle install CMD bundle exec rackup --port $PORT