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