Skip to content

Debugging Render's Docker

Keith Schacht edited this page May 5, 2024 · 7 revisions

If you want to locally run Docker just as it is in production, here are the steps to do so. For example, this is helpful if there is an asset compilation issue on Render which is not occurring locally and you want to fully replicate the production environment.

  1. Temporarily edit your Dockerfile, in the section START OF RENDER and change PORT to 3000
  2. Temporarily edit production.rb to comment out config.force_ssl = true
  3. Build the image: docker build --target render-production -t hostedgpt-deployment:latest .
  4. Temporarily edit your compose.yml file to:
  • Remove the volumes: section
  • Remove the whole build: block and replace with image: hostedgpt-deployment:latest
  • Add this to the environment: section: RAILS_ENV=production and RAILS_FORCE_SSL=false and SECRET_KEY_BASE=[copy from Render]
  1. Temporarily edit production.rb to comment out config.force_ssl = true
  2. Run docker compose up and everything should start
  3. Visit http://localhost:3000 but if you are incorrectly redirected to http:// try it in incognito, if you still are redirected then within Chrome go to chrome://net-internals/#hsts and within the "Delete domain security policies" search for "localhost" and Delete. Then try again.
  4. Note: Local changes to rails files will no longer be reflected in the running instance. You can connect to the running docker instance to inspect the filesystem by doing: docker ps and finding the container ID for "hostedgpt-base" then do docker exec -it PASTE_ID /bin/sh
Clone this wiki locally