Search code examples
ruby-on-railsdokku

Rails app deployed with Dokku can't be accessed


Using DigitalOcean droplet with IPv4 147.182.203.240. Followed the Dokku tutorial with some changes, which I'll list here. The list also includes things I've already tried

  • App built from Dockerfile. Container exposes port 3000 through EXPOSE
  • Setting path for correct Dockerfile with dokku builder-dockerfile:set myapp dockerfile-path .dokku/Dockerfile
  • Set config.force_ssl = false on production.rb
  • As recommended on some sites, nginx's sites-enabled/default folder was deleted. Nginx then restarted but no changes. Even after this change, Nginx home page stills shows up intermittently when you visit the drolet IP: http://147.182.203.240.
  • Following Dokku docs on EXPOSE, added a map from 3000 to 80, and deleted map from 000 to 3000. dokku ports:list returns:
dokku ports:list blog-demo
-----> Port mappings for blog-demo
    -----> scheme  host port  container port
    http           80         3000

dokku domains:report returns:

dokku domains:report
=====> blog-demo domains information
       Domains app enabled:           true
       Domains app vhosts:            147.182.203.240
       Domains global enabled:        true
       Domains global vhosts:         packer-6481b5fa-f32f-c6ab-b44d-a2621ac2dcee
  • Finally added firewall exception to port 3000: sudo ufw allow 3000/tcp. IP still shows nginx home page, or "Unable to connect" message. However IP:3000 shows a blue screenenter image description here However rails app logs don't show nothing relevant.

App is apparently running without issues, I can see the usual Puma logs when server starts (Listening on http://127.0.0.1:3000), but I'm unable to connect the app with the IP to see the Rails home page. Any suggestions are welcomed.


Solution

  • After a completely clean re-try, it looks like there was a mix of settings from an older Dokku version.

    Digital Ocean's 1-click Dokku droplet does not include the latest Dokku version. After an initial setup, I upgraded the version without any success to the deployment. As a last resource, I created a non-1-click droplet and then installed Dokku manually, everything works as expected.

    There are already issues in the official repo, so nothing new to add.