tcg@mbp hello-phoenix % fly launch
An existing fly.toml file was found for app hello-phoenix
? Would you like to copy its configuration to the new app? Yes
Creating app in /Users/tcg/Source/hello-phoenix
Scanning source code
Detected a Dockerfile app
? App Name (leave blank to use an auto-generated name): hello-firefly
Automatically selected personal organization: Tom Gosling
? Select region: lhr (London, United Kingdom)
Created app hello-firefly in organization personal
Wrote config file fly.toml
Your app is ready. Deploy with flyctl deploy
? Would you like to deploy now? No
tcg@mbp hello-phoenix % open .
tcg@mbp hello-phoenix % st .
tcg@mbp hello-phoenix % mix phx.gen.secret
05:29:29.467 [info] Compiling file system watcher for Mac…
05:29:30.222 [info] Done.
==> file_system
Compiling 7 files (.ex)
Generated file_system app
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Analyzing applications…
===> Compiling ranch
===> Analyzing applications…
===> Compiling telemetry
==> telemetry_metrics
Compiling 7 files (.ex)
Generated telemetry_metrics app
===> Analyzing applications…
===> Compiling telemetry_poller
==> decimal
Compiling 4 files (.ex)
Generated decimal app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> castore
Compiling 1 file (.ex)
Generated castore app
==> esbuild
Compiling 3 files (.ex)
Generated esbuild app
==> db_connection
Compiling 14 files (.ex)
Generated db_connection app
==> ecto
Compiling 56 files (.ex)
Generated ecto app
==> phoenix_pubsub
Compiling 11 files (.ex)
Generated phoenix_pubsub app
===> Analyzing applications…
===> Compiling cowlib
===> Analyzing applications…
===> Compiling cowboy
===> Analyzing applications…
===> Compiling cowboy_telemetry
==> mime
Compiling 1 file (.ex)
Generated mime app
==> postgrex
Compiling 62 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 26 files (.ex)
Generated ecto_sql app
==> plug_crypto
Compiling 5 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 41 files (.ex)
warning: System.stacktrace/0 is deprecated. Use STACKTRACE instead
lib/plug/conn/wrapper_error.ex:23: Plug.Conn.WrapperError.reraise/3
Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> phoenix_view
Compiling 5 files (.ex)
Generated phoenix_view app
==> plug_cowboy
Compiling 5 files (.ex)
Generated plug_cowboy app
==> phoenix
Compiling 68 files (.ex)
Generated phoenix app
==> phoenix_live_reload
Compiling 4 files (.ex)
Generated phoenix_live_reload app
==> phoenix_live_view
Compiling 28 files (.ex)
Generated phoenix_live_view app
==> phoenix_live_dashboard
Compiling 40 files (.ex)
Generated phoenix_live_dashboard app
==> swoosh
Compiling 36 files (.ex)
Generated swoosh app
==> phoenix_ecto
Compiling 7 files (.ex)
Generated phoenix_ecto app
==> hello_phoenix
bJIQpAIjwZjMqVglY2b8aR0hSqZNl+UwulNlvE8hJYMMqepLzteaiQssdFGe4KGs
tcg@mbp hello-phoenix % fly secrets set SECRET_KEY_BASE=bJIQpAIjwZjMqVglY2b8aR0hSqZNl+UwulNlvE8hJYMMqepLzteaiQssdFGe4KGs
Secrets are staged for the first deployment
tcg@mbp hello-phoenix % fly postgres create
? App Name: hello-firefly-db
Automatically selected personal organization: Tom Gosling
? Select region: lhr (London, United Kingdom)
? Select VM size: shared-cpu-1x - 256
? Volume size (GB): 10
Creating postgres cluster hello-firefly-db in organization personal
Postgres cluster hello-firefly-db created
Username: postgres
Password: 3420c6a2f99b8dc7c6f0bfc3f60042dbc6de29a8c0c53b9f
Hostname: hello-firefly-db.internal
Proxy Port: 5432
PG Port: 5433
Save your credentials in a secure place, you won’t be able to see them again!
Monitoring Deployment
2 desired, 2 placed, 2 healthy, 0 unhealthy [health checks: 6 total, 6 passing]
→ v0 deployed successfully
Connect to postgres
Any app within the personal organization can connect to postgres using the above credentials and the hostname “hello-firefly-db.internal.”
For example: postgres://postgres:3420c6a2f99b8dc7c6f0bfc3f60042dbc6de29a8c0c53b9f@hello-firefly-db.internal:5432
See the postgres docs for more information on next steps, managing postgres, connecting from outside fly: Postgres on Fly
tcg@mbp hello-phoenix % fly postgres attach --postgres-app hello-firefly-db
Postgres cluster hello-firefly-db is now attached to hello-firefly
The following secret was added to hello-firefly:
DATABASE_URL=postgres://hello_firefly_kzor184wdoxemvj5:ffbe30905abe7095b5c10d1499834f3a@hello-firefly-db.internal:5432/hello_firefly?sslmode=disable
tcg@mbp hello-phoenix % fly deploy --remote-only
Deploying hello-firefly
==> Validating app configuration
→ Validating app configuration done
Services
TCP 80/443 ⇢ 8080
Remote builder fly-builder-rough-sea-6798 ready
==> Creating build context
→ Creating build context done
==> Building image with Docker
→ docker host: 20.10.8 linux x86_64
Sending build context to Docker daemon 4.482MB
Step 1/35 : ARG BUILDER_IMAGE=“hexpm/elixir:1.12.3-erlang-24.1.2-ubuntu-groovy-20210325”
Step 2/35 : ARG RUNNER_IMAGE=“ubuntu:20.10”
Step 3/35 : ARG MIX_ENV=“prod”
Step 4/35 : FROM ${BUILDER_IMAGE} as builder
—> 2c890f6fd283
Step 5/35 : RUN apt-get update -y && apt-get install -y build-essential git python3 curl && apt-get clean && rm -f /var/lib/apt/lists/_
—> Using cache
—> 3442dfa0e6ad
Step 6/35 : WORKDIR /app
—> Using cache
—> 892bf729c8c3
Step 7/35 : RUN mix local.hex --force && mix local.rebar --force
—> Using cache
—> 16337a1600a6
Step 8/35 : ARG MIX_ENV
—> Using cache
—> 09485b7eb5da
Step 9/35 : ENV MIX_ENV="${MIX_ENV}"
—> Using cache
—> e123b4a0bc06
Step 10/35 : COPY mix.exs mix.lock ./
—> Using cache
—> f348bff2d66c
Step 11/35 : RUN mix deps.get --only $MIX_ENV
—> Using cache
—> 4cc6b88e0cef
Step 12/35 : RUN mkdir config
—> Using cache
—> 5924dea41dd7
Step 13/35 : COPY config/config.exs config/$MIX_ENV.exs config/
—> Using cache
—> f0add00dd678
Step 14/35 : RUN mix deps.compile
—> Using cache
—> a74179ef647d
Step 15/35 : COPY priv priv
—> 47e26ad3e033
Step 16/35 : COPY assets assets
—> 214969cdc5d9
Step 17/35 : RUN mix assets.deploy
—> Running in 4ca9bb908285
04:35:46.138 [debug] Downloading esbuild from https://registry.npmjs.org/esbuild-linux-64/-/esbuild-linux-64-0.12.18.tgz
…/priv/static/assets/app.js 79.1kb
…/priv/static/assets/app.css 10.8kb
Done in 27ms
Generated hello_phoenix app
Check your digested files at “priv/static”
—> 05d758c0f174
Step 18/35 : COPY lib lib
—> 76e7ecc75a60
Step 19/35 : RUN mix compile
—> Running in 89a98d850bd3
Compiling 15 files (.ex)
Generated hello_phoenix app
—> 8f20d2edcf58
Step 20/35 : COPY config/runtime.exs config/
—> dd2317fe09e8
Step 21/35 : COPY rel rel
—> 1451d881fb8a
Step 22/35 : RUN mix release
—> Running in adb42426a3d1
-
assembling hello_phoenix-0.1.0 on MIX_ENV=prod
-
using config/runtime.exs to configure the release at runtime
-
creating _build/prod/rel/hello_phoenix/releases/0.1.0/vm.args
-
creating _build/prod/rel/hello_phoenix/releases/0.1.0/remote.vm.args
-
creating _build/prod/rel/hello_phoenix/releases/0.1.0/env.sh
-
creating _build/prod/rel/hello_phoenix/releases/0.1.0/env.bat
-
skipping elixir.bat for windows (bin/elixir.bat not found in the Elixir installation)
-
skipping iex.bat for windows (bin/iex.bat not found in the Elixir installation)
Release created at _build/prod/rel/hello_phoenix!
To start your system
_build/prod/rel/hello_phoenix/bin/hello_phoenix start
Once the release is running:
To connect to it remotely
_build/prod/rel/hello_phoenix/bin/hello_phoenix remote
To stop it gracefully (you may also send SIGINT/SIGTERM)
_build/prod/rel/hello_phoenix/bin/hello_phoenix stop
To list all commands:
_build/prod/rel/hello_phoenix/bin/hello_phoenix
—> c861af3ef0f0
Step 23/35 : FROM ${RUNNER_IMAGE}
—> e508bd6d694e
Step 24/35 : ARG MIX_ENV
—> Using cache
—> 72397d377000
Step 25/35 : RUN apt-get update -y && apt-get install -y libstdc++6 openssl curl libncurses5 locales && apt-get clean && rm -f /var/lib/apt/lists/_
—> Using cache
—> 5520da1fbb3f
Step 26/35 : RUN sed -i ‘/en_US.UTF-8/s/^# //g’ /etc/locale.gen && locale-gen
—> Using cache
—> 5bfd6c84cab7
Step 27/35 : ENV LANG en_US.UTF-8
—> Using cache
—> bc95485a0a9d
Step 28/35 : ENV LANGUAGE en_US:en
—> Using cache
—> c97ce1fd319e
Step 29/35 : ENV LC_ALL en_US.UTF-8
—> Using cache
—> e7a73ca6210d
Step 30/35 : WORKDIR “/app”
—> Using cache
—> 7b2570c02518
Step 31/35 : RUN chown nobody /app
—> Using cache
—> fda2c889a59b
Step 32/35 : USER nobody
—> Using cache
—> afd1c2dc27ce
Step 33/35 : COPY --from=builder --chown=nobody /app/_build/"${MIX_ENV}"/rel ./
Error error building: error rendering build status stream: unable to convert uid/gid chown string to host mapping: can’t find gid for group nobody: no such group: nobody