bitwalker / distillery

Simplify deployments in Elixir with OTP releases!
MIT License
2.96k stars 397 forks source link

Dockerized via Walkthrough Phoenix 1.4 app not running #603

Closed njwest closed 5 years ago

njwest commented 5 years ago

Steps to reproduce

  1. mix phx.new myapp
  2. add Distillery 2.0 to mix.exs
  3. mix release.init
  4. Follow official guide on Deploying with Docker
  5. Configure and build psqldb container with postgress image and user: postgres, password: postgres, database: myapp_prod
  6. docker-compose up

Description of issue

Am trying to build and run Distillery 2.0 on Docker using the Deploying with Docker guide and a plain Phoenix 1.4 app with PostgreSQL, but after following all of the steps and running docker-compose up, I get:

This page isn’t working
localhost didn’t send any data.

from localhost:4000 and localhost:80 (tried running on both ports)

If I misconfigure the database in the Phoenix app, I do get

web_1     | 09:00:13.938 [error] Postgrex.Protocol (#PID<0.1512.0>) failed to connect: ** (DBConnection.ConnectionError) tcp connect (localhost:5432): connection refused - :econnrefused

so my docker container is doing something, but when configured properly (I think) I just get:

Starting myapp_psqldb_1 ... done
Starting  myapp_web_1    ... done
Attaching to myapp_psqldb_1, myapp_web_1
psqldb_1  | 2018-12-08 09:37:04.782 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
psqldb_1  | 2018-12-08 09:37:04.782 UTC [1] LOG:  listening on IPv6 address "::", port 5432
psqldb_1  | 2018-12-08 09:37:04.785 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
psqldb_1  | 2018-12-08 09:37:04.799 UTC [20] LOG:  database system was interrupted; last known up at 2018-12-08 09:26:55 UTC
psqldb_1  | 2018-12-08 09:37:05.052 UTC [20] LOG:  database system was not properly shut down; automatic recovery in progress
psqldb_1  | 2018-12-08 09:37:05.054 UTC [20] LOG:  redo starts at 0/1657A90
psqldb_1  | 2018-12-08 09:37:05.055 UTC [20] LOG:  invalid record length at 0/1657AC8: wanted 24, got 0
psqldb_1  | 2018-12-08 09:37:05.055 UTC [20] LOG:  redo done at 0/1657A90
psqldb_1  | 2018-12-08 09:37:05.065 UTC [1] LOG:  database system is ready to accept connections

Docker files

docker-compose.yml:

version: '3.5'

services:
  web:
    image: "myapp:latest"
    ports:
      - "4000:4000"
      # - "4000:4000"z
    env_file:
      - myapp/config/docker.env
    depends_on:
      - psqldb

  psqldb:
    image: psqldb:latest
    volumes:
      - "./volumes/postgres:/var/lib/postgresql/data"
    ports:
      - "5432:5432"

volumes:
  psqldb:
    driver: "local"

Phoenix app Dockerfile (copied + pasted from official Distillery guide):

# The version of Alpine to use for the final image
# This should match the version of Alpine that the `elixir:1.7.2-alpine` image uses
ARG ALPINE_VERSION=3.8

FROM elixir:1.7.2-alpine AS builder

# The following are build arguments used to change variable parts of the image.
# The name of your application/release (required)
ARG APP_NAME
# The version of the application we are building (required)
ARG APP_VSN
# The environment to build with
ARG MIX_ENV=prod
# Set this to true if this release is not a Phoenix app
ARG SKIP_PHOENIX=false
# If you are using an umbrella project, you can change this
# argument to the directory the Phoenix app is in so that the assets
# can be built
ARG PHOENIX_SUBDIR=.

ENV SKIP_PHOENIX=${SKIP_PHOENIX} \
    APP_NAME=${APP_NAME} \
    APP_VSN=${APP_VSN} \
    MIX_ENV=${MIX_ENV}

# By convention, /opt is typically used for applications
WORKDIR /opt/app

# This step installs all the build tools we'll need
RUN apk update && \
  apk upgrade --no-cache && \
  apk add --no-cache \
    nodejs \
    yarn \
    git \
    build-base && \
  mix local.rebar --force && \
  mix local.hex --force

# This copies our app source code into the build container
COPY . .

RUN mix do deps.get, deps.compile, compile

# This step builds assets for the Phoenix app (if there is one)
# If you aren't building a Phoenix app, pass `--build-arg SKIP_PHOENIX=true`
# This is mostly here for demonstration purposes
RUN if [ ! "$SKIP_PHOENIX" = "true" ]; then \
  cd ${PHOENIX_SUBDIR}/assets && \
  yarn install && \
  yarn deploy && \
  cd .. && \
  mix phx.digest; \
fi

RUN \
  mkdir -p /opt/built && \
  mix release --verbose && \
  cp _build/${MIX_ENV}/rel/${APP_NAME}/releases/${APP_VSN}/${APP_NAME}.tar.gz /opt/built && \
  cd /opt/built && \
  tar -xzf ${APP_NAME}.tar.gz && \
  rm ${APP_NAME}.tar.gz

# From this line onwards, we're in a new image, which will be the image used in production
FROM alpine:${ALPINE_VERSION}

# The name of your application/release (required)
ARG APP_NAME

RUN apk update && \
    apk add --no-cache \
      bash \
      openssl-dev

ENV REPLACE_OS_VARS=true \
    APP_NAME=${APP_NAME}

WORKDIR /opt/app

COPY --from=builder /opt/built .

CMD trap 'exit' INT; /opt/app/bin/${APP_NAME} foreground

Build logs

docker-compose up:

Starting myapp_psqldb_1 ... done
Starting myapp_web_1    ... done
Attaching to myapp_psqldb_1, myapp_web_1
psqldb_1  | 2018-12-08 09:37:04.782 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
psqldb_1  | 2018-12-08 09:37:04.782 UTC [1] LOG:  listening on IPv6 address "::", port 5432
psqldb_1  | 2018-12-08 09:37:04.785 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
psqldb_1  | 2018-12-08 09:37:04.799 UTC [20] LOG:  database system was interrupted; last known up at 2018-12-08 09:26:55 UTC
psqldb_1  | 2018-12-08 09:37:05.052 UTC [20] LOG:  database system was not properly shut down; automatic recovery in progress
psqldb_1  | 2018-12-08 09:37:05.054 UTC [20] LOG:  redo starts at 0/1657A90
psqldb_1  | 2018-12-08 09:37:05.055 UTC [20] LOG:  invalid record length at 0/1657AC8: wanted 24, got 0
psqldb_1  | 2018-12-08 09:37:05.055 UTC [20] LOG:  redo done at 0/1657A90
psqldb_1  | 2018-12-08 09:37:05.065 UTC [1] LOG:  database system is ready to accept connections

make build :

$ make build

docker build --build-arg APP_NAME=`grep 'app:' mix.exs | sed -e 's/\[//g' -e 's/ //g' -e 's/app://' -e 's/[:,]//g'` \
            --build-arg APP_VSN=`grep 'version:' mix.exs | cut -d '"' -f2` \
            -t `grep 'app:' mix.exs | sed -e 's/\[//g' -e 's/ //g' -e 's/app://' -e 's/[:,]//g'`:`grep 'version:' mix.exs | cut -d '"' -f2`-`git rev-parse --short HEAD` \
            -t `grep 'app:' mix.exs | sed -e 's/\[//g' -e 's/ //g' -e 's/app://' -e 's/[:,]//g'`:latest .
fatal: not a git repository (or any of the parent directories): .git
Sending build context to Docker daemon  130.4MB
Step 1/21 : ARG ALPINE_VERSION=3.8
Step 2/21 : FROM elixir:1.7.2-alpine AS builder
 ---> 97d4954089b0
Step 3/21 : ARG APP_NAME
 ---> Using cache
 ---> 4b364e48af4e
Step 4/21 : ARG APP_VSN
 ---> Using cache
 ---> ca6ba1d26d4c
Step 5/21 : ARG MIX_ENV=prod
 ---> Using cache
 ---> 17661d45111d
Step 6/21 : ARG SKIP_PHOENIX=false
 ---> Using cache
 ---> 40813ac39f5e
Step 7/21 : ARG PHOENIX_SUBDIR=.
 ---> Using cache
 ---> f43e5a5f43e5
Step 8/21 : ENV SKIP_PHOENIX=${SKIP_PHOENIX}     APP_NAME=${APP_NAME}     APP_VSN=${APP_VSN}     MIX_ENV=${MIX_ENV}
 ---> Using cache
 ---> 1242508158cf
Step 9/21 : WORKDIR /opt/app
 ---> Using cache
 ---> 5f5e40dc899c
Step 10/21 : RUN apk update &&   apk upgrade --no-cache &&   apk add --no-cache     nodejs     yarn     git     build-base &&   mix local.rebar --force &&   mix local.hex --force
 ---> Using cache
 ---> 8788e4b99e70
Step 11/21 : COPY . .
 ---> c9c18106cca4
Step 12/21 : RUN mix do deps.get, deps.compile, compile
 ---> Running in 797e3afd951c
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
  artificery 0.2.6
  connection 1.0.4
  cowboy 2.6.1
  cowlib 2.7.0
  db_connection 2.0.3
  decimal 1.6.0
  distillery 2.0.12
  ecto 3.0.4
  ecto_sql 3.0.3
  file_system 0.2.6
  gettext 0.16.1
  jason 1.1.2
  mime 1.3.1
  phoenix 1.4.0
  phoenix_ecto 4.0.0
  phoenix_html 2.12.0
  phoenix_live_reload 1.2.0
  phoenix_pubsub 1.1.1
  plug 1.7.1
  plug_cowboy 2.0.0
  plug_crypto 1.0.0
  postgrex 0.14.1
  ranch 1.7.1
  telemetry 0.2.0
All dependencies up to date
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Compiling ranch
===> Failed to restore /opt/app/deps/ranch/.rebar3/erlcinfo file. Discarding it.

==> telemetry
Compiling 3 files (.ex)
Generated telemetry app
==> decimal
Compiling 1 file (.ex)
Generated decimal app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> db_connection
Compiling 16 files (.ex)
Generated db_connection app
==> ecto
Compiling 54 files (.ex)
Generated ecto app
==> phoenix_pubsub
Compiling 13 files (.ex)
Generated phoenix_pubsub app
===> Compiling cowlib
===> Failed to restore /opt/app/deps/cowlib/.rebar3/erlcinfo file. Discarding it.

===> Compiling cowboy
===> Failed to restore /opt/app/deps/cowboy/.rebar3/erlcinfo file. Discarding it.

==> mime
Compiling 2 files (.ex)
Generated mime app
==> postgrex
Compiling 61 files (.ex)
Generated postgrex app
==> ecto_sql
Compiling 23 files (.ex)
Generated ecto_sql app
==> artificery
Compiling 10 files (.ex)
Generated artificery app
==> distillery
Compiling 33 files (.ex)
Generated distillery app
==> plug_crypto
Compiling 4 files (.ex)
Generated plug_crypto app
==> plug
Compiling 1 file (.erl)
Compiling 38 files (.ex)
warning: System.stacktrace/0 outside of rescue/catch clauses is deprecated. If you want to support only Elixir v1.7+, you must access __STACKTRACE__ inside a rescue/catch. If you want to support earlier Elixir versions, move System.stacktrace/0 inside a rescue/catch
  lib/plug/conn/wrapper_error.ex:23

Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> plug_cowboy
Compiling 5 files (.ex)
Generated plug_cowboy app
==> phoenix
Compiling 67 files (.ex)
Generated phoenix app
==> phoenix_ecto
Compiling 6 files (.ex)
Generated phoenix_ecto app
==> myapp
Compiling 13 files (.ex)
Generated myapp app
Removing intermediate container 797e3afd951c
 ---> 5e5c3d12e780
Step 13/21 : RUN if [ ! "$SKIP_PHOENIX" = "true" ]; then   cd ${PHOENIX_SUBDIR}/assets &&   yarn install &&   yarn deploy &&   cd .. &&   mix phx.digest; fi
 ---> Running in 03ce048488c3
yarn install v1.7.0
info No lockfile found.
[1/4] Resolving packages...
warning css-loader > cssnano > autoprefixer > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning css-loader > cssnano > postcss-merge-rules > caniuse-api > browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
warning webpack-cli > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
warning webpack-cli > webpack-addons > jscodeshift > babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read babeljs.io/env to update! 
warning webpack-cli > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
warning webpack-cli > webpack-addons > jscodeshift > nomnom@1.8.1: Package no longer supported. Contact support@npmjs.com for more info.
[2/4] Fetching packages...
info fsevents@1.2.4: The platform "linux" is incompatible with this module.
info "fsevents@1.2.4" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 33.21s.
yarn run v1.7.0
$ webpack --mode production
Hash: 31c32da247111571de0a
Version: webpack 4.4.0
Time: 1869ms
Built at: 2018-12-8 09:13:19
                Asset       Size  Chunks             Chunk Names
       ../css/app.css   9.58 KiB       0  [emitted]  ./js/app.js
               app.js   1.84 KiB       0  [emitted]  ./js/app.js
       ../favicon.ico   1.23 KiB          [emitted]  
../images/phoenix.png   13.6 KiB          [emitted]  
        ../robots.txt  202 bytes          [emitted]  
   [1] ./css/app.css 39 bytes {0} [built]
   [2] ./js/app.js 493 bytes {0} [built]
   [3] multi ./js/app.js 28 bytes {0} [built]
    + 3 hidden modules
Child mini-css-extract-plugin node_modules/css-loader/index.js!css/app.css:
       [1] ./node_modules/css-loader!./css/phoenix.css 10.9 KiB {0} [built]
       [2] ./node_modules/css-loader!./css/app.css 288 bytes {0} [built]
        + 1 hidden module
Done in 3.69s.
Check your digested files at "priv/static"
Removing intermediate container 03ce048488c3
 ---> b6737d1c1564
Step 14/21 : RUN   mkdir -p /opt/built &&   mix release --verbose &&   cp _build/${MIX_ENV}/rel/${APP_NAME}/releases/${APP_VSN}/${APP_NAME}.tar.gz /opt/built &&   cd /opt/built &&   tar -xzf ${APP_NAME}.tar.gz &&   rm ${APP_NAME}.tar.gz
 ---> Running in c84033dc8423
==> Loading configuration..
==> Assembling release..
==> Building release myapp:0.1.0 using environment prod
==> Discovered applications:
  > phoenix_ecto-4.0.0
  |
  |  from: _build/prod/lib/phoenix_ecto
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :ecto
  |      :plug
  |  includes: none
  |_____

  > plug_crypto-1.0.0
  |
  |  from: _build/prod/lib/plug_crypto
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :crypto
  |  includes: none
  |_____

  > kernel-6.0
  |
  |  from: /usr/local/lib/erlang/lib/kernel-6.0
  |  applications: none
  |  includes: none
  |_____

  > asn1-5.0.6
  |
  |  from: /usr/local/lib/erlang/lib/asn1-5.0.6
  |  applications:
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > public_key-1.6.1
  |
  |  from: /usr/local/lib/erlang/lib/public_key-1.6.1
  |  applications:
  |      :asn1
  |      :crypto
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > ssl-9.0
  |
  |  from: /usr/local/lib/erlang/lib/ssl-9.0
  |  applications:
  |      :crypto
  |      :public_key
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > ranch-1.7.1
  |
  |  from: _build/prod/lib/ranch
  |  applications:
  |      :kernel
  |      :stdlib
  |      :ssl
  |  includes: none
  |_____

  > cowlib-2.7.0
  |
  |  from: _build/prod/lib/cowlib
  |  applications:
  |      :kernel
  |      :stdlib
  |      :crypto
  |  includes: none
  |_____

  > cowboy-2.6.1
  |
  |  from: _build/prod/lib/cowboy
  |  applications:
  |      :kernel
  |      :stdlib
  |      :crypto
  |      :cowlib
  |      :ranch
  |  includes: none
  |_____

  > plug_cowboy-2.0.0
  |
  |  from: _build/prod/lib/plug_cowboy
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :cowboy
  |      :plug
  |  includes: none
  |_____

  > artificery-0.2.6
  |
  |  from: _build/prod/lib/artificery
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > distillery-2.0.12
  |
  |  from: _build/prod/lib/distillery
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :runtime_tools
  |      :artificery
  |  includes: none
  |_____

  > decimal-1.6.0
  |
  |  from: _build/prod/lib/decimal
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > connection-1.0.4
  |
  |  from: _build/prod/lib/connection
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > db_connection-2.0.3
  |
  |  from: _build/prod/lib/db_connection
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :connection
  |  includes: none
  |_____

  > postgrex-0.14.1
  |
  |  from: _build/prod/lib/postgrex
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :db_connection
  |      :decimal
  |      :crypto
  |  includes: none
  |_____

  > eex-1.7.2
  |
  |  from: /usr/local/bin/../lib/eex
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > phoenix-1.4.0
  |
  |  from: _build/prod/lib/phoenix
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :eex
  |      :crypto
  |      :phoenix_pubsub
  |      :plug
  |  includes: none
  |_____

  > mime-1.3.1
  |
  |  from: _build/prod/lib/mime
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |  includes: none
  |_____

  > plug-1.7.1
  |
  |  from: _build/prod/lib/plug
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :mime
  |      :plug_crypto
  |  includes: none
  |_____

  > runtime_tools-1.13
  |
  |  from: /usr/local/lib/erlang/lib/runtime_tools-1.13
  |  applications:
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > stdlib-3.5.1
  |
  |  from: /usr/local/lib/erlang/lib/stdlib-3.5.1
  |  applications:
  |      :kernel
  |  includes: none
  |_____

  > crypto-4.3.1
  |
  |  from: /usr/local/lib/erlang/lib/crypto-4.3.1
  |  applications:
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > phoenix_pubsub-1.1.1
  |
  |  from: _build/prod/lib/phoenix_pubsub
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :crypto
  |  includes: none
  |_____

  > ecto-3.0.4
  |
  |  from: _build/prod/lib/ecto
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :crypto
  |      :decimal
  |  includes: none
  |_____

  > phoenix_html-2.12.0
  |
  |  from: _build/prod/lib/phoenix_html
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :plug
  |  includes: none
  |_____

  > compiler-7.2.3
  |
  |  from: /usr/local/lib/erlang/lib/compiler-7.2.3
  |  applications:
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > jason-1.1.2
  |
  |  from: _build/prod/lib/jason
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > sasl-3.2
  |
  |  from: /usr/local/lib/erlang/lib/sasl-3.2
  |  applications:
  |      :kernel
  |      :stdlib
  |  includes: none
  |_____

  > telemetry-0.2.0
  |
  |  from: _build/prod/lib/telemetry
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |  includes: none
  |_____

  > gettext-0.16.1
  |
  |  from: _build/prod/lib/gettext
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |  includes: none
  |_____

  > ecto_sql-3.0.3
  |
  |  from: _build/prod/lib/ecto_sql
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :telemetry
  |      :db_connection
  |      :ecto
  |  includes: none
  |_____

  > iex-1.7.2
  |
  |  from: /usr/local/bin/../lib/iex
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > mix-1.7.2
  |
  |  from: /usr/local/bin/../lib/mix
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > logger-1.7.2
  |
  |  from: /usr/local/bin/../lib/logger
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |  includes: none
  |_____

  > myapp-0.1.0
  |
  |  from: _build/prod/lib/myapp
  |  applications:
  |      :kernel
  |      :stdlib
  |      :elixir
  |      :logger
  |      :runtime_tools
  |      :gettext
  |      :jason
  |      :phoenix_pubsub
  |      :postgrex
  |      :ecto_sql
  |      :distillery
  |      :phoenix_html
  |      :plug_cowboy
  |      :phoenix
  |      :phoenix_ecto
  |  includes: none
  |_____

  > elixir-1.7.2
  |
  |  from: /usr/local/bin/../lib/elixir
  |  applications:
  |      :kernel
  |      :stdlib
  |      :compiler
  |  includes: none
  |_____

==> Running validation checks..
    > Mix.Releases.Checks.Erts * PASS
    > Mix.Releases.Checks.Cookie * PASS
    > Mix.Releases.Checks.LoadedOrphanedApps * PASS
==> Generated overlay vars:
    release_name=:myapp
    release_version="0.1.0"
    is_upgrade=false
    upgrade_from=:latest
    dev_mode=false
    include_erts=true
    include_src=false
    include_system_libs=true
    erl_opts=""
    run_erl_env=""
    erts_vsn="10.0.5"
    output_dir="_build/prod/rel/myapp"
==> Copying applications to _build/prod/rel/myapp
==> Generating start_erl.data
==> Generating vm.args from rel/vm.args
==> Generating sys.config from config/config.exs
==> Including ERTS 10.0.5 from /usr/local/lib/erlang/erts-10.0.5
==> Generating boot scripts
==> Generating RELEASES
==> Applying overlays
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/pre_configure.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/post_configure.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/pre_start.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/post_start.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/pre_stop.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/post_stop.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/pre_upgrade.d
==> Applying mkdir overlay
    dst: releases/0.1.0/hooks/post_upgrade.d
==> Applying copy overlay
    src: _build/prod/lib/distillery/priv/libexec
    dst: releases/0.1.0/libexec
==> Applying mkdir overlay
    dst: releases/0.1.0/commands
==> Packaging release..
==> Archiving myapp-0.1.0
==> Writing archive to /opt/app/_build/prod/rel/myapp/releases/0.1.0/myapp.tar.gz
==> Updating archive..
==> Including system libs from current Erlang installation
==> Saving archive..
==> Archive saved!
Release successfully built!
To start the release you have built, you can use one of the following tasks:

    # start a shell, like 'iex -S mix'
    > _build/prod/rel/myapp/bin/myapp console

    # start in the foreground, like 'mix run --no-halt'
    > _build/prod/rel/myapp/bin/myapp foreground

    # start in the background, must be stopped with the 'stop' command
    > _build/prod/rel/myapp/bin/myapp start

If you started a release elsewhere, and wish to connect to it:

    # connects a local shell to the running node
    > _build/prod/rel/myapp/bin/myapp remote_console

    # connects directly to the running node's console
    > _build/prod/rel/myapp/bin/myapp attach

For a complete listing of commands and their use:

    > _build/prod/rel/myapp/bin/myapp help
Removing intermediate container c84033dc8423
 ---> 5ab36d33e206
Step 15/21 : FROM alpine:${ALPINE_VERSION}
 ---> 196d12cf6ab1
Step 16/21 : ARG APP_NAME
 ---> Using cache
 ---> 18377002c35d
Step 17/21 : RUN apk update &&     apk add --no-cache       bash       openssl-dev
 ---> Using cache
 ---> 46a07e9b1ff5
Step 18/21 : ENV REPLACE_OS_VARS=true     APP_NAME=${APP_NAME}
 ---> Using cache
 ---> 3d40311cbd92
Step 19/21 : WORKDIR /opt/app
 ---> Using cache
 ---> be38790cbeb6
Step 20/21 : COPY --from=builder /opt/built .
 ---> 92017b940ecc
Step 21/21 : CMD trap 'exit' INT; /opt/app/bin/${APP_NAME} foreground
 ---> Running in 36582dbe162a
Removing intermediate container 36582dbe162a
 ---> bbb08b29f657
Successfully built bbb08b29f657
Successfully tagged myapp:0.1.0-
Successfully tagged myapp:latest
njwest commented 5 years ago

Hmm, I’m thinking the problem be the lack of a web server for the distillery release in this case

njwest commented 5 years ago

In case anyone wanders on this, the problem was that my app wasn't in a git repo, so make build wasn't generating a proper release... 🤦‍♂️