Dockerized Rails App

I’m trying to dockerize my rails app because my application uses yt-dlp. I tried to write a build script which would install yt-dlp in my ruby environment, but it seems like we have permissions to install it. If I run the build script in the shell it installs but it seems like it doesn’t persist the storage.

This was the build script that I wrote:

indent() {
  sed -u 's/^/       /'

echo "-----> Installing yt-dlp"
cd $HOME
mkdir -p "vendor"
cd "vendor"
mkdir -p ./yt-dlp/bin/
cd ./yt-dlp/bin/
wget $(curl -s \
| grep -e "browser_download_url.*yt-dlp" \
| cut -d : -f 2,3 \
| tr -d \" \
| grep -e "yt-dlp$")
chmod a+rx yt-dlp
echo "Adding to PATH" | indent

mkdir -p "$HOME/.profile.d/"
touch $PROFILE
echo export PATH="$PATH:$HOME/vendor/yt-dlp/bin" >> $PROFILE
source $HOME/.profile.d/

cd $HOME/project/src

bundle install

bundle exec rake assets:precompile

bundle exec rake assets:clean

bundle exec rake db:migrate

I tried to write a docker file which would install yt-dlp and to run that on the server but I receive a boot loop.

This is my docker file

This is the server response when I try to deploy it.

Does anybody have a successful rails app docker deploy that I could use as a base?

Hi Justin,

I’ve replied to your previous posts/tickets, maybe they’ll help?

Kind regards