Hi, Thanks for the tutorials. I will look further tomorrow. I tried my server, Synology NAS, using container docker; however, I always have an issue with the docker command when sending to my Synology NAS using SSH. Then I tried to add my SSH keys to the profile and bash to the container that I built, but still, I could not push my rails using Kamal I got same error docker command issue. However, when I access my Synology using SSH and do the command docker -v, it is working. It seems there is a missing configuration, or Synology is not allowing Kamal. Any idea, how to use kamal in synology nas? thanks
I don't have a Synology NAS and it's weird that you can manually run it but it doesn't work with Kamal. Personally, I don't think a NAS is a good place to put containers/VMs. Mainly because when you have file systems like ZFS, I'd want the NAS to be able to allocate as much RAM as it can to ARC. The machine that I used on this episode was an Intel Ultra 7 155H ASUS NUC. https://www.asus.com/us/displays-desktops/nucs/nuc-mini-pcs/asus-nuc-14-pro/
Additional comment about the video. I'm not sure if I conveyed it well, but one of the awesome things about using Cloudflare Tunnels is that you don't have to make any changes to your network, including opening up any ports on your firewall/router. This means that you could run this on your home network or even a school network (assuming that they're not blocking certain kinds of traffic). But always check with your ISP and/or provider to see if you're within their terms of use.
Another cool thing about this approach is that if you do have a Dynamic IP Address then everything will continue to work if your ISP gives you a different IP. You won't have to go into your DNS provider to update IP Addresses. This is because the Cloudflare Tunnel initiates an outgoing request to Cloudflare's servers and keeps a connection open.
David KimuraIt would also help if you can showcase the observability aspects(resource monitoring, logs, auto-scaling) of Kamal in one of your upcoming eposides.
This is what it looks like in the episode. You could also have an environment variable for the database URL and use that too instead of providing the username, password, host and port individually.
As long as the two droplets are able to communicate with each other (on the same VPC/network) it should work. Can you shell into the postgres server from the rails server's terminal? I am not sure of the firewalling that digital ocean does on the VMs, but the postgres port would need to be exposed to at least the rails VM.
Another cool thing about this approach is that if you do have a Dynamic IP Address then everything will continue to work if your ISP gives you a different IP. You won't have to go into your DNS provider to update IP Addresses. This is because the Cloudflare Tunnel initiates an outgoing request to Cloudflare's servers and keeps a connection open.
would love to see this using a bare bone hetzner machine, or multple servers, line ovh, hetzner, DO just to see how that will look
default: &default adapter: postgresql encoding: unicode # For details on connection pooling, see Rails configuration guide # https://guides.rubyonrails.org/configuring.html#database-pooling pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> <% if ENV["DB_HOST"] %> host: <%= ENV["DB_HOST"] %> username: postgres password: postgres <% end %> ... production: primary: &primary_production <<: *default database: example_production username: example host: 192.168.1.117 password: <%= Rails.application.credentials.dig(:postgres, :password) %> cache: <<: *primary_production database: example_production_cache migrations_paths: db/cache_migrate queue: <<: *primary_production database: example_production_queue migrations_paths: db/queue_migrate cable: <<: *primary_production database: example_production_cable migrations_paths: db/cable_migrate