Skip to content

Debugging Render's Docker

Keith Schacht edited this page Jun 14, 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 docker-compose.yml file to:
  • Remove ALL references to volumes:
  • Remove the whole build: block and replace with image: hostedgpt-deployment:latest
  • Add these lines to the environment: section:
RAILS_ENV=production
RAILS_FORCE_SSL=false
RUN_SOLID_QUEUE_IN_PUMA=true
SECRET_KEY_BASE=[copy from Render or from local proj]
RAILS_MASTER_KEY=[copy from Render or from local proj]
  1. Run docker compose up and everything should start. NOTE: If you get an error about key length then change your RAILS_MASTER_KEY to be what is in your local master.key file, Render seems to generate the wrong length key but somehow it works on Render's servers
  2. 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.
  3. 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