I have the following Dockerfile:
FROM ruby:2.3.3
ENV "GEM_HOME" "/home/gems"
ENV "BUNDLE_PATH" "/home/gems"
EXPOSE 3000
WORKDIR /home/webapp
CMD ["/home/webapp/startup.sh"]
The startup.sh file looks like this:
#!/bin/sh
bundle install
bundle exec rails server puma -b 0.0.0.0 -e production
With this Dockerfile I build an image on Docker Hub. I choose this image in the Azure Linux App Service Website Docker Container settings. No problems here.
Via FTP I upload my Rails app (is in folder webapp, this folder contains the startup.sh file) in the / folder of the Linux App Service. According to a comment on this page: https://learn.microsoft.com/en-us/azure/app-service-web/app-service-linux-how-to-create-a-web-app the / of the App Service is mapped to /home in the container.
However my webapp won't show if I access it via the browser. In
/LogFiles/docker/docker_***_err.log
it says:
standard_init_linux.go:178: exec user process caused "no such file or directory"
What I am trying to achieve is that my app data and gems are outside the container image. I tested the image successfully on my local mac with:
docker run -it -p 8888:3000 -v /Users/***/Desktop/ms:/home xyz/rubyimage
The ms folder contains the folder webapp.