Instructions on deploying a static website not working

Deploying a static page according to the docs doesn’t seem to work. flyctl version is:

flyctl v0.0.280 linux/amd64 Commit: eea5515 BuildDate: 2022-01-06T13:55:37Z

This is on Ubuntu 20.04.

First I tried deploying a folder with simply an index.html, after that failed I confirmed that the issue is present when doing the structural equivalent of git clone https://github.com/fly-apps/hellostatic-builtin from the docs.

Reproduction/output:

flaki@ubuntu:~/work$ git clone https://github.com/fly-apps/hellostatic-builtin
Cloning into 'hellostatic-builtin'...
remote: Enumerating objects: 7, done.
remote: Counting objects: 100% (7/7), done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 1), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (7/7), 1.16 KiB | 596.00 KiB/s, done.

flaki@ubuntu:~/work$ cd hellostatic-builtin/

flaki@ubuntu:~/work/hellostatic-builtin$ flyctl launch --verbose
Creating app in /home/flaki/work/hellostatic-builtin
Scanning source code
Could not find a Dockerfile, nor detect a runtime or framework from source code. Continuing with a blank app.
? App Name (leave blank to use an auto-generated name): 
? Select organization: Flaki (personal)
? Select region: fra (Frankfurt, Germany)
Created app ancient-shape-384 in organization personal
Wrote config file fly.toml
flaki@ubuntu:~/work/hellostatic-builtin$

The key message here seems to be the “Scanning source code. Could not find a Dockerfile, nor detect a runtime or framework from source code. Continuing with a blank app.” The builder/port selection is not offered as part of flyctl launch, as described by the docs, and a “blank” app is deployed (which seems to be stuck permanently in the build phase):

flaki@ubuntu:~/work/hellostatic-builtin$ flyctl apps list
NAME                            OWNER           STATUS  LATEST DEPLOY 
ancient-shape-384               personal        pending              
fly-builder-twilight-rain-6580  personal        pending              

Hi mate,

Does your fly.toml contain the below bit; if it doesn’t, can you add it and try
flyctl deploy -c fly.toml

[build]
  builtin = "static"

No the (generated) fly.toml does not contain a [build] key (which is expected after the error message displayed during flyctl launch). My point was not about getting this working, but that flyctl behaves differently from what is described in the main guides in the docs, and I believe either/both the docs and the static builder example needs updating.

I just took a look at this and it might be an issue on flyctl not detecting it’s a static app.

We’ll take a look!

1 Like

Thanks for the report. The 0.0.281 flyctl release comes with a new static site scanner. It will drop a Dockerfile and setup fly.toml. Docs and the example repo have been updated as well.

1 Like