basic rails app fails to deploy

Hello,
I am discovering fly.io and tested it on a simple rails app that powers a static site, but the deploy failed.

> $ flyctl launch
Creating app in /home/gui/work/web/polygonjs/lab/site
Scanning source code
Detected a Dockerfile app
? App Name (leave blank to use an auto-generated name): polygon-lab
Automatically selected personal organization: guillaume fradin
? Select region: lhr (London, United Kingdom)
Created app polygon-lab in organization personal
Wrote config file fly.toml
? Would you like to setup a Postgresql database now? No
? Would you like to deploy now? Yes
Deploying polygon-lab
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
WARN Remote builder did not start in time. Check remote builder logs with `flyctl logs -a fly-builder-bold-wood-8996`
Error error connecting to docker: remote builder app unavailable


> $ flyctl logs -a fly-builder-bold-wood-8996
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/meshcentral/yarn.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/oci-cli/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/pgadmin/yarn.lock
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/pgadmin/yarn.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/procs/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/procs/default.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/pulumi/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/pulumi/data.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/admin/tigervnc/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/archivers/afio/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/archivers/afio/default.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/archivers/ndstool/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/archivers/unar/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/archivers/unar/default.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/archivers/unzip/CVE-2014-8140.diff
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/abcm2ps/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/abcm2ps/default.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/accuraterip-checksum/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/accuraterip-checksum/default.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/acousticbrainz-client/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/botamusique/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/botamusique/default.nix
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/botamusique/src.json
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/botamusique/unconditional-relative-state-paths.patch
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/ezstream/
2022-05-10T10:46:09Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/mp3cat/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/mpdcron/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/mpdcron/Gemfile.lock
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/opl3bankeditor/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/trx/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/audio/tts/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/android-backup-extractor/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/bdsync/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/borgbackup/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/borgbackup/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/borgmatic/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/discordchatexporter-cli/updater.sh
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/duplicity/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/mastodon-archive/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/monolith/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/mydumper/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/restic/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/tsm-client/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/backup/zfs-replicate/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/bluetooth/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/bluetooth/obex-data-server/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/bluetooth/obex-data-server/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/bluetooth/obexd/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/bluetooth/obexftp/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/compression/bsdiff/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/compression/bzip2/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/compression/pigz/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/compression/zdelta/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/compression/zdelta/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/apfs-fuse/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/apfs-fuse/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/ciopfs/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/darling-dmg/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/djmount/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/file-rename/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/httm/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/idsk/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/mergerfs/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/rar2fs/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/rmfuse/update
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/squashfs/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/filesystems/wiimms-iso-tools/fix-paths.diff
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/games/minecraft/optifine/generic.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/cuneiform/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/dpic/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/glxinfo/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/icoutils/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/leela/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/pfstools/pfstools.patch
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/pngtoico/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/qrcode/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/qrcode/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/quirc/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/rocket/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/sic-image-cli/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/xcftools/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/graphics/xcur2png/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/evscript/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/fcitx-engines/fcitx-mozc/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/fcitx5/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/fcitx5/update.py
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/fcitx5/with-addons.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/fusuma/gemset.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/ibus-engines/ibus-table-others/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/ibus/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/ibus/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/kime/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/skk/skktools/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/skk/skktools/default.nix
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/
2022-05-10T10:46:10Z app[4369c660] lhr [info]store/f6v195p56gq9inl3065r0qjrbidmmp37-nixpkgs/nixpkgs/pkgs/tools/inputmethods/tegaki-zinnia-japanese/default.nix

I don’t have a docker app, so this may be needed, but I would assume a message would confirm this?
Curious to see if anybody has some thoughts on this.

Can you post the contents of the Dockerfile?

unfortunately I do not have any.
Should I then understand that this is a requirement?

It’s not a requirement, but if flyctl launch detects a Dockerfile (as you can see in the command output), it will deploy using that file. What does the output of ls look like in your lab/site directory?

I see. Looks like flyctl created it then. Here is the ls output:

$ ls -l
total 420
drwxrwxr-x  11 gui gui   4096 Nov 25 00:27 app
-rw-rw-r--   1 gui gui   1975 Nov 30 14:32 babel.config.js
drwxr-xr-x   2 gui gui   4096 Nov 25 00:28 bin
drwxrwxr-x   6 gui gui   4096 Nov 25 00:28 config
-rw-rw-r--   1 gui gui    160 Nov 25 00:27 config.ru
drwxrwxr-x   2 gui gui   4096 Nov 25 00:30 db
-rw-------   1 gui gui   2298 May 10 11:44 Dockerfile
-rw-rw-r--   1 gui gui    695 May 10 11:45 fly.toml
-rw-rw-r--   1 gui gui   2226 Dec  4 21:16 Gemfile
-rw-rw-r--   1 gui gui   5571 Dec  4 21:16 Gemfile.lock
drwxrwxr-x   4 gui gui   4096 Nov 25 00:27 lib
drwxrwxr-x   2 gui gui   4096 Dec  1 17:54 log
drwxrwxr-x 707 gui gui  20480 Nov 30 14:32 node_modules
-rw-rw-r--   1 gui gui    399 Dec  1 18:00 package.json
-rw-rw-r--   1 gui gui    224 Nov 25 00:28 postcss.config.js
drwxrwxr-x   6 gui gui   4096 Dec  1 18:02 public
-rw-rw-r--   1 gui gui    227 Nov 25 00:27 Rakefile
-rw-rw-r--   1 gui gui      0 Mar 24 14:14 README.md
drwxrwxr-x   2 gui gui   4096 Nov 25 00:27 storage
drwxrwxr-x  10 gui gui   4096 Nov 25 00:27 test
drwxrwxr-x   7 gui gui   4096 Nov 25 00:29 tmp
-rw-rw-r--   1 gui gui    578 Nov 30 17:25 tsconfig.json
drwxrwxr-x   2 gui gui   4096 Nov 25 00:27 vendor
-rw-rw-r--   1 gui gui 317756 Nov 30 14:30 yarn.lock

And here is the content of the Dockerfile:

# syntax = docker/dockerfile:experimental
ARG RUBY_VERSION=2.7.3
ARG VARIANT=jemalloc-slim
FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-${VARIANT} as base

ARG NODE_VERSION=16
ARG BUNDLER_VERSION=2.3.9

ARG RAILS_ENV=production
ENV RAILS_ENV=${RAILS_ENV}

ENV RAILS_SERVE_STATIC_FILES true
ENV RAILS_LOG_TO_STDOUT true

ARG BUNDLE_WITHOUT=development:test
ARG BUNDLE_PATH=vendor/bundle
ENV BUNDLE_PATH ${BUNDLE_PATH}
ENV BUNDLE_WITHOUT ${BUNDLE_WITHOUT}

RUN mkdir /app
WORKDIR /app
RUN mkdir -p tmp/pids

SHELL ["/bin/bash", "-c"]

RUN curl https://get.volta.sh | bash

ENV BASH_ENV ~/.bashrc
ENV VOLTA_HOME /root/.volta
ENV PATH $VOLTA_HOME/bin:/usr/local/bin:$PATH

RUN volta install node@${NODE_VERSION} && volta install yarn

FROM base as build_deps

ARG DEV_PACKAGES="git build-essential libpq-dev wget vim curl gzip xz-utils libsqlite3-dev"
ENV DEV_PACKAGES ${DEV_PACKAGES}

RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y ${DEV_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

FROM build_deps as gems

RUN gem install -N bundler -v ${BUNDLER_VERSION}

COPY Gemfile* ./
RUN bundle install &&  rm -rf vendor/bundle/ruby/*/cache

FROM build_deps as node_modules

COPY package*json ./
COPY yarn.* ./

RUN if [ -f "yarn.lock" ]; then \
    yarn install; \
    elif [ -f "package-lock.json" ]; then \
    npm install; \
    else \
    mkdir node_modules; \
    fi

FROM base

ARG PROD_PACKAGES="postgresql-client file vim curl gzip libsqlite3-0"
ENV PROD_PACKAGES=${PROD_PACKAGES}

RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt \
    --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt \
    apt-get update -qq && \
    apt-get install --no-install-recommends -y \
    ${PROD_PACKAGES} \
    && rm -rf /var/lib/apt/lists /var/cache/apt/archives

COPY --from=gems /app /app
COPY --from=node_modules /app/node_modules /app/node_modules

ENV SECRET_KEY_BASE 1

COPY . .

RUN bundle exec rails assets:precompile

ENV PORT 8080

ARG SERVER_COMMAND="bundle exec puma -C config/puma.rb"
ENV SERVER_COMMAND ${SERVER_COMMAND}
CMD ${SERVER_COMMAND}

Thanks. Can you try this again and post the output of the deployment?

Sure thing, here it is:

$ flyctl launch
An existing fly.toml file was found for app polygon-lab
App is not running, deploy...
Deploying polygon-lab
==> Validating app configuration
--> Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-bold-wood-8996 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 293.9s (0/1)                                                                                                                                                                                                                                                       
[+] Building 53.8s (19/23)                                                                                                                                                                                                                                                      
 => [internal] load remote build context                                                                                                                                                                                                                                   0.0s
 => copy /context /                                                                                                                                                                                                                                                        9.8s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                                                                                                                      1.3s
 => docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                                                                                                                                        0.8s
 => => resolve docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                                                                                                                                            0.0s
 => => sha256:3c244c0c6fc9d6aa3ddb73af4264b3a23597523ac553294218c13735a2c6cf79 528B / 528B                                                                                                                                                                                 0.0s
 => => sha256:b587adb6abfd8d6c87b1f649c2e924d53f148ae1c7f0ceaaded70b27b44dccb5 1.21kB / 1.21kB                                                                                                                                                                             0.0s
 => => sha256:d7f0373ffb1d5ac3477b10ab7f91cba7c5df586c72e7e4a12649024efdc0d531 9.64MB / 9.64MB                                                                                                                                                                             0.5s
 => => sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5 1.69kB / 1.69kB                                                                                                                                                                             0.0s
 => => extracting sha256:d7f0373ffb1d5ac3477b10ab7f91cba7c5df586c72e7e4a12649024efdc0d531                                                                                                                                                                                  0.3s
 => [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:2.7.3-jemalloc-slim                                                                                                                                                                                          1.0s
 => [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:2.7.3-jemalloc-slim@sha256:547d28f5b3ae7ff1004a1f531f8c0d8724c94cb6da460b7ce9bd93177e0a2040                                                                                                                               5.1s
 => => resolve quay.io/evl.ms/fullstaq-ruby:2.7.3-jemalloc-slim@sha256:547d28f5b3ae7ff1004a1f531f8c0d8724c94cb6da460b7ce9bd93177e0a2040                                                                                                                                    0.1s
 => => sha256:b4d181a07f8025e00e0cb28f1cc14613da2ce26450b80c54aea537fa93cf3bda 27.15MB / 27.15MB                                                                                                                                                                           0.6s
 => => sha256:71871327ea1e1ce2a009cebbc2b6d8d10d123fcbe52772ce9b1e16d62c069b6a 15.63MB / 15.63MB                                                                                                                                                                           1.8s
 => => sha256:547d28f5b3ae7ff1004a1f531f8c0d8724c94cb6da460b7ce9bd93177e0a2040 741B / 741B                                                                                                                                                                                 0.0s
 => => sha256:6bd7adf08ed9d3145a7f3f14d9292690c2ab6db694125ba5cf40de6c1084ced3 3.42kB / 3.42kB                                                                                                                                                                             0.0s
 => => extracting sha256:b4d181a07f8025e00e0cb28f1cc14613da2ce26450b80c54aea537fa93cf3bda                                                                                                                                                                                  2.5s
 => => extracting sha256:71871327ea1e1ce2a009cebbc2b6d8d10d123fcbe52772ce9b1e16d62c069b6a                                                                                                                                                                                  1.6s
 => [base 2/6] RUN mkdir /app                                                                                                                                                                                                                                              1.2s
 => [base 3/6] WORKDIR /app                                                                                                                                                                                                                                                0.0s
 => [base 4/6] RUN mkdir -p tmp/pids                                                                                                                                                                                                                                       0.5s
 => [base 5/6] RUN curl https://get.volta.sh | bash                                                                                                                                                                                                                        2.8s
 => [base 6/6] RUN volta install node@16 && volta install yarn                                                                                                                                                                                                             2.4s
 => [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt     apt-get update -qq &&     apt-get install --no-install-recommends -y git build-essential   22.7s 
 => [stage-4 1/5] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt     apt-get update -qq &&     apt-get install --no-install-recommends -y     postgresql-client  10.5s 
 => [gems 1/3] RUN gem install -N bundler -v 2.3.9                                                                                                                                                                                                                         1.7s 
 => [node_modules 1/3] COPY package*json ./                                                                                                                                                                                                                                0.4s 
 => [node_modules 2/3] COPY yarn.* ./                                                                                                                                                                                                                                      0.5s 
 => CANCELED [node_modules 3/3] RUN if [ -f "yarn.lock" ]; then     yarn install;     elif [ -f "package-lock.json" ]; then     npm install;     else     mkdir node_modules;     fi                                                                                       3.0s 
 => [gems 2/3] COPY Gemfile* ./                                                                                                                                                                                                                                            0.6s 
 => ERROR [gems 3/3] RUN bundle install &&  rm -rf vendor/bundle/ruby/*/cache                                                                                                                                                                                              1.5s 
------                                                                                                                                                                                                                                                                          
 > [gems 3/3] RUN bundle install &&  rm -rf vendor/bundle/ruby/*/cache:                                                                                                                                                                                                         
#16 1.350 Your Ruby version is 2.7.3, but your Gemfile specified 3.0.3                                                                                                                                                                                                          
------                                                                                                                                                                                                                                                                          
Error error building: executor failed running [/bin/bash -c bundle install &&  rm -rf vendor/bundle/ruby/*/cache]: exit code: 18

OK, we’re getting further now! The first issue was an intermittent network error connecting to your remote builder VM.

Now you got connected, but the default version of Ruby is set to 2.7.3. To make it match your Gemfile, add this to your fly.toml:

[env]
   RUBY_VERSION = "3.0.3"

Then try fly deploy --remote-only. This is the command you’d use to deploy, normally. fly launch is just for the first time you setup an app.

Thank you. Although I seem to still have that same error. Here are the output as well as the content of the fly.toml.

the output:

$ fly deploy --remote-only
==> Verifying app config
--> Verified app config
==> Building image
Remote builder fly-builder-bold-wood-8996 ready
==> Creating build context
--> Creating build context done
==> Building image with Docker
--> docker host: 20.10.12 linux x86_64
[+] Building 188.2s (0/1)                                                                                                                                                                                                                                                       
[+] Building 19.0s (19/23)                                                                                                                                                                                                                                                      
 => [internal] load remote build context                                                                                                                                                                                                                                   0.0s
 => copy /context /                                                                                                                                                                                                                                                       11.2s
 => resolve image config for docker.io/docker/dockerfile:experimental                                                                                                                                                                                                      0.7s
 => CACHED docker-image://docker.io/docker/dockerfile:experimental@sha256:600e5c62eedff338b3f7a0850beb7c05866e0ef27b2d2e8c02aa468e78496ff5                                                                                                                                 0.0s
 => [internal] load metadata for quay.io/evl.ms/fullstaq-ruby:2.7.3-jemalloc-slim                                                                                                                                                                                          0.4s
 => [base 1/6] FROM quay.io/evl.ms/fullstaq-ruby:2.7.3-jemalloc-slim@sha256:547d28f5b3ae7ff1004a1f531f8c0d8724c94cb6da460b7ce9bd93177e0a2040                                                                                                                               0.0s
 => CACHED [base 2/6] RUN mkdir /app                                                                                                                                                                                                                                       0.0s
 => CACHED [base 3/6] WORKDIR /app                                                                                                                                                                                                                                         0.0s
 => CACHED [base 4/6] RUN mkdir -p tmp/pids                                                                                                                                                                                                                                0.0s
 => CACHED [base 5/6] RUN curl https://get.volta.sh | bash                                                                                                                                                                                                                 0.0s
 => CACHED [base 6/6] RUN volta install node@16 && volta install yarn                                                                                                                                                                                                      0.0s
 => CACHED [stage-4 1/5] RUN --mount=type=cache,id=prod-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=prod-apt-lib,sharing=locked,target=/var/lib/apt     apt-get update -qq &&     apt-get install --no-install-recommends -y     postgresql-  0.0s
 => CACHED [build_deps 1/1] RUN --mount=type=cache,id=dev-apt-cache,sharing=locked,target=/var/cache/apt     --mount=type=cache,id=dev-apt-lib,sharing=locked,target=/var/lib/apt     apt-get update -qq &&     apt-get install --no-install-recommends -y git build-esse  0.0s
 => CACHED [gems 1/3] RUN gem install -N bundler -v 2.3.9                                                                                                                                                                                                                  0.0s
 => CACHED [gems 2/3] COPY Gemfile* ./                                                                                                                                                                                                                                     0.0s
 => ERROR [gems 3/3] RUN bundle install &&  rm -rf vendor/bundle/ruby/*/cache                                                                                                                                                                                              1.1s
 => CACHED [node_modules 1/3] COPY package*json ./                                                                                                                                                                                                                         0.0s
 => CACHED [node_modules 2/3] COPY yarn.* ./                                                                                                                                                                                                                               0.0s
 => CANCELED [node_modules 3/3] RUN if [ -f "yarn.lock" ]; then     yarn install;     elif [ -f "package-lock.json" ]; then     npm install;     else     mkdir node_modules;     fi                                                                                       1.0s
------                                                                                                                                                                                                                                                                          
 > [gems 3/3] RUN bundle install &&  rm -rf vendor/bundle/ruby/*/cache:
#16 1.042 Your Ruby version is 2.7.3, but your Gemfile specified 3.0.3
------
Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -c bundle install &&  rm -rf vendor/bundle/ruby/*/cache]: exit code: 18

and fly.toml content

# fly.toml file generated for polygon-lab on 2022-05-10T11:45:54+01:00

app = "polygon-lab"

kill_signal = "SIGINT"
kill_timeout = 5
processes = []

[env]
  RUBY_VERSION = "3.0.3"

[experimental]
  allowed_public_ports = []
  auto_rollback = true

[[services]]
  http_checks = []
  internal_port = 8080
  processes = ["app"]
  protocol = "tcp"
  script_checks = []

  [services.concurrency]
    hard_limit = 25
    soft_limit = 20
    type = "connections"

  [[services.ports]]
    force_https = true
    handlers = ["http"]
    port = 80

  [[services.ports]]
    handlers = ["tls", "http"]
    port = 443

  [[services.tcp_checks]]
    grace_period = "1s"
    interval = "15s"
    restart_limit = 0
    timeout = "2s"

Oops, my mistake! I need to document this :slight_smile:

fly.toml should be:

[build]
  [build.args]
    RUBY_VERSION = "3.0.3"

Looks like that worked!
Thanks a lot for your help.

I’ll now move to the next steps of my migration to fly.io and report back if I hit other issues.

Thanks a lot again

Great! I don’t think many people have used this Rails setup yet, so I’d love to hear how it goes. You can also configure your Node version, as you can see in the Dockerfile, in the same way.

ah, what is unique about this rails setup? It’s very typical, at least to my knowledge.
Are there other best practices that you would recommend?

By ‘setup’, I mean using a Dockerfile like this one to deploy. A lot of platforms will use the Ruby buildpack to deploy. This is fine, but we’ve found that it can be pretty bulky. A Dockerfile gives you some more control at the cost of being a bit more complex up front.

For I don’t recommend anything else specific. Just post here if you have any more issues.

1 Like

Hello again,

I’ve decided to try and deploy the same app with Docker only, to better understand how that could simplify the deploy process. And while I can run the docker container in my local machine, I’ve hit a couple issues on fly.io. Let me know if you’d prefer me to open a new thread, but in the mean time, here are the problems:

curl https://polygon-lab-docker-test.fly.dev/
curl: (56) OpenSSL SSL_read: error:0A000126:SSL routines::unexpected eof while reading, errno 0

and the log is:



$ fly logs -a polygon-lab-docker-test

Waiting for logs...

2022-06-05T23:43:36.804 runner[7c3d2729] lhr [info] Starting instance

2022-06-05T23:43:37.284 runner[7c3d2729] lhr [info] Configuring virtual machine

2022-06-05T23:43:37.291 runner[7c3d2729] lhr [info] Pulling container image

2022-06-05T23:44:57.651 runner[7c3d2729] lhr [info] Unpacking image

2022-06-05T23:45:35.511 runner[7c3d2729] lhr [info] Preparing kernel init

2022-06-05T23:45:37.388 runner[7c3d2729] lhr [info] Configuring firecracker

2022-06-05T23:45:37.489 runner[7c3d2729] lhr [info] Starting virtual machine

2022-06-05T23:45:37.703 app[7c3d2729] lhr [info] Starting init (commit: e3eb6d2)...

2022-06-05T23:45:37.728 app[7c3d2729] lhr [info] Preparing to run: `entrypoint.sh bundle exec puma -C config/puma.rb` as root

2022-06-05T23:45:37.759 app[7c3d2729] lhr [info] 2022/06/05 23:45:37 listening on [fdaa:0:62cb:a7b:28df:7c3d:2729:2]:22 (DNS: [fdaa::3]:53)

2022-06-05T23:45:38.054 app[7c3d2729] lhr [info] Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.

2022-06-05T23:45:38.452 app[7c3d2729] lhr [info] Puma starting in single mode...

2022-06-05T23:45:38.452 app[7c3d2729] lhr [info] * Puma version: 5.5.2 (ruby 3.1.2-p20) ("Zawgyi")

2022-06-05T23:45:38.452 app[7c3d2729] lhr [info] * Min threads: 5

2022-06-05T23:45:38.453 app[7c3d2729] lhr [info] * Max threads: 5

2022-06-05T23:45:38.453 app[7c3d2729] lhr [info] * Environment: p oduction

2022-06-05T23:45:38.453 app[7c3d2729] lhr [info] * PID: 515

2022-06-05T23:45:39.904 app[7c3d2729] lhr [info] * Listening on http://0.0.0.0:3000

2022-06-05T23:45:39.907 app[7c3d2729] lhr [info] Use Ctrl-C to stop

2022-06-05T23:46:15.556 proxy[7c3d2729] lhr [error] Error 2011: App is unhealthy

2022-06-05T23:47:40.369 proxy[7c3d2729] lhr [error] Error 2011: App is unhealthy

2022-06-05T23:49:05.570 proxy[7c3d2729] lhr [error] Error 2011: App is unhealthy

2022-06-05T23:52:45.437 proxy[7c3d2729] lhr [error] Error 2011: App is unhealthy

2022-06-05T23:54:10.251 proxy[7c3d2729] lhr [error] Error 2011: App is unhealthy

2022-06-05T23:54:10.657 proxy[7c3d2729] lhr [error] Error 2011: App is unhealthy

I’m unfortunately not sure where to look to understand what Error 2011: App is unhealthy is referring to.

And here is the Dockerfile, which I’ve rewrote from scratch (it’s very likely I removed something I should not)

# syntax=docker/dockerfile:1
FROM ruby:3.1.2
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN gem install bundler
RUN bundle install

RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list
RUN apt update && apt install yarn

COPY . /myapp

RUN yarn install --ignore-engines --force

ENV RAILS_ENV=production
ENV SECRET_KEY_BASE=redacted
ENV RAILS_SERVE_STATIC_FILES=1
RUN bin/rails assets:precompile
COPY . /myapp

# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
ENTRYPOINT ["entrypoint.sh"]
EXPOSE 3000

# Configure the main process to run when running the image
# CMD ["rails", "server", "-b", "0.0.0.0"]
CMD ["bundle", "exec", "puma", "-C", "config/puma.rb"]

and entrypoint.sh:

#!/bin/bash
set -e

# Remove a potentially pre-existing server.pid for Rails.
rm -f /myapp/tmp/pids/server.pid

#!/bin/bash
# bundle install --jobs 20 --retry 5

# Then exec the container's main process (what's set as CMD in the Dockerfile).
exec "$@"

Is that enough information for you to help debugging this? Let me know if there is more I should share here.

1 Like

I have similar problem. RUBY_VERSION is “3.1.2” and this is the error message I have when I run fly deploy:

Error failed to fetch an image or build from source: error building: executor failed running [/bin/bash -c bin/rails fly:build]: exit code: 1

Can you give us more information? Is this using a custom docker image or a buildpack?

Can you try Build images with nixpacks?

Okay, let me try that and get back to you on this.

I got this error when I tried to build images with nitpicks

Error: Please install Docker to build the app https://docs.docker.com/engine/install/
Error failed to fetch an image or build from source: exit status 1

I’m using a Mac please.