You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Replace Ruby version below with your application's Ruby version. Delete this comment.FROMruby:2.7.1RUNapt-getupdate -qq && apt-getinstall -ynodejspostgresql-clientRUNmkdir/my_appWORKDIR /my_appCOPYGemfile/my_app/GemfileCOPYGemfile.lock/my_app/Gemfile.lockRUNbundleinstallCOPY. /my_app# Add a script to be executed every time the container starts.COPYentrypoint.sh/usr/bin/
RUNchmod +x /usr/bin/entrypoint.shENTRYPOINT["entrypoint.sh"]EXPOSE3000# Start the main process.CMD["rails","server","-b","0.0.0.0"]
docker-compose.yml :: Add to my_app root directory
#!/bin/bashset -e
# Remove a potentially pre-existing server.pid for Rails.
rm -f /my_app/tmp/pids/server.pid
# Then exec the container's main process (what's set as CMD in the Dockerfile).exec"$@"
With your bash command in docker-compose, you don't need the entrypoint.sh in my_app right? Seems like one or the other??? Fighting with similar issue.
With your bash command in docker-compose, you don't need the entrypoint.sh in my_app right? Seems like one or the other??? Fighting with similar issue.
@epugh, that is correct, and I need to update that line; great catch! I am now exclusively using an entrypoint.sh file in both development and production instead of a CMD line in the Dockerfile. I find using the bash script produces consistent results when I deploy to GCP Cloud Run and Kubernetes.
Hi @iEvolv3
great guide, just had a question as to why are we copying the gemfile and gemfile.lock separately and then copying the entire application directory? and same goes for `entry point file.
Why don't we just copy the app directory that contains all these files?
With your bash command in docker-compose, you don't need the entrypoint.sh in my_app right? Seems like one or the other??? Fighting with similar issue.