Skip to content

Instantly share code, notes, and snippets.

@mazz
Created July 13, 2018 02:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mazz/7bd328a3b8e1153ae705fbe245f677d4 to your computer and use it in GitHub Desktop.
Save mazz/7bd328a3b8e1153ae705fbe245f677d4 to your computer and use it in GitHub Desktop.
docker phoenix
~/webapp/phx/1.4.0-dev/dynt (master ✔) ᐅ rm -rf _build
~/webapp/phx/1.4.0-dev/dynt (master ✔) ᐅ ./build.sh
Sending build context to Docker daemon 434.2kB
Step 1/14 : FROM bitwalker/alpine-elixir-phoenix:1.6.4
1.6.4: Pulling from bitwalker/alpine-elixir-phoenix
2fdfe1cd78c2: Pull complete
2c0d9bb9fb45: Pull complete
d93f0b84684a: Pull complete
335734700e0f: Pull complete
a3bef11652be: Pull complete
cfe2a2cc5202: Pull complete
cbfcb434946f: Pull complete
Digest: sha256:ca88bbb8595f9fd6ffcb4d3f9d75472e0b3140ba7265793a5696b3cc82526871
Status: Downloaded newer image for bitwalker/alpine-elixir-phoenix:1.6.4
---> a82ac42d7da3
Step 2/14 : ENV MIX_ENV prod
---> Running in 6fa3267829c6
Removing intermediate container 6fa3267829c6
---> 8935e347787f
Step 3/14 : ADD . .
---> 8b4f12932e1a
Step 4/14 : RUN mix deps.get --only prod
---> Running in fb65108949d7
* Getting phoenix (https://github.com/phoenixframework/phoenix.git)
remote: Counting objects: 37540, done.
remote: Compressing objects: 100% (82/82), done.
remote: Total 37540 (delta 3), reused 60 (delta 0), pack-reused 37458
Receiving objects: 100% (37540/37540), 9.34 MiB | 1.99 MiB/s, done.
Resolving deltas: 100% (24252/24252), done.
Resolving Hex dependencies...
Dependency resolution completed:
connection 1.0.4
cowboy 1.1.2
cowlib 1.0.2
db_connection 1.1.3
decimal 1.5.0
distillery 1.5.3
ecto 2.2.10
gettext 0.15.0
jason 1.1.1
mime 1.3.0
phoenix_ecto 3.3.0
phoenix_html 2.11.2
phoenix_pubsub 1.0.2
plug 1.6.1
poolboy 1.5.1
postgrex 0.13.5
ranch 1.3.2
* Getting phoenix_pubsub (Hex package)
* Getting phoenix_ecto (Hex package)
* Getting postgrex (Hex package)
* Getting phoenix_html (Hex package)
* Getting gettext (Hex package)
* Getting jason (Hex package)
* Getting cowboy (Hex package)
* Getting distillery (Hex package)
* Getting cowlib (Hex package)
* Getting ranch (Hex package)
* Getting plug (Hex package)
* Getting mime (Hex package)
* Getting connection (Hex package)
* Getting db_connection (Hex package)
* Getting decimal (Hex package)
* Getting ecto (Hex package)
* Getting poolboy (Hex package)
Removing intermediate container fb65108949d7
---> 25d68b143430
Step 5/14 : RUN mix deps.compile
---> Running in 9371b16f1cbe
==> connection
Compiling 1 file (.ex)
Generated connection app
==> gettext
Compiling 1 file (.yrl)
Compiling 1 file (.erl)
Compiling 20 files (.ex)
Generated gettext app
===> Compiling ranch
==> poolboy (compile)
Compiled src/poolboy_worker.erl
Compiled src/poolboy_sup.erl
Compiled src/poolboy.erl
==> decimal
Compiling 1 file (.ex)
Generated decimal app
==> jason
Compiling 8 files (.ex)
Generated jason app
==> db_connection
Compiling 23 files (.ex)
Generated db_connection app
==> phoenix_pubsub
Compiling 12 files (.ex)
Generated phoenix_pubsub app
===> Compiling cowlib
src/cow_multipart.erl:392: Warning: call to crypto:rand_bytes/1 will fail, since it was removed in 20.0; use crypto:strong_rand_bytes/1
===> Compiling cowboy
==> mime
Compiling 2 files (.ex)
Generated mime app
==> plug
Compiling 1 file (.erl)
Compiling 48 files (.ex)
Generated plug app
==> phoenix_html
Compiling 8 files (.ex)
Generated phoenix_html app
==> phoenix
Compiling 67 files (.ex)
warning: module :cowboy_websocket is not a behaviour (in module Phoenix.Endpoint.Cowboy2Handler)
lib/phoenix/endpoint/cowboy2_handler.ex:1
Generated phoenix app
==> postgrex
Compiling 62 files (.ex)
warning: Enum.partition/2 is deprecated, use Enum.split_with/2
lib/postgrex/error_code.ex:14
Generated postgrex app
==> ecto
Compiling 70 files (.ex)
Generated ecto app
==> distillery
Compiling 19 files (.ex)
Generated distillery app
==> phoenix_ecto
Compiling 6 files (.ex)
Generated phoenix_ecto app
Removing intermediate container 9371b16f1cbe
---> cd12d4b3a7c7
Step 6/14 : WORKDIR assets
Removing intermediate container 405e2e7dd9c7
---> 7b8e1be3ff92
Step 7/14 : RUN npm i npm@latest -g
---> Running in 2ed213f98cd4
/usr/bin/npm -> /usr/lib/node_modules/npm/bin/npm-cli.js
/usr/bin/npx -> /usr/lib/node_modules/npm/bin/npx-cli.js
+ npm@6.1.0
added 228 packages from 48 contributors, removed 79 packages and updated 91 packages in 42.785s
Removing intermediate container 2ed213f98cd4
---> 8ab627c9c4fe
Step 8/14 : RUN npm i
---> Running in 7020ea77e8ba
npm WARN assets No description
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
added 896 packages from 578 contributors and audited 14690 packages in 38.647s
found 0 vulnerabilities
Removing intermediate container 7020ea77e8ba
---> fe2b9a3a2d39
Step 9/14 : RUN npm run deploy
---> Running in 32d29ae825dc
> @ deploy /opt/app/assets
> webpack --mode production
Hash: cffcbd16ae547f0a5b01
Version: webpack 4.4.0
Time: 2575ms
Built at: 2018-7-13 02:04:41
Asset Size Chunks Chunk Names
../css/app.css 9.32 KiB 0 [emitted] main
app.js 1.35 KiB 0 [emitted] main
../favicon.ico 1.23 KiB [emitted]
../images/phoenix.png 13.6 KiB [emitted]
../robots.txt 202 bytes [emitted]
[0] ../deps/phoenix_html/priv/static/phoenix_html.js 1.28 KiB {0} [built]
[3] ./css/app.css 39 bytes {0} [built]
[4] ./js/app.js 218 bytes {0} [built]
+ 2 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.5 KiB {0} [built]
[2] ./node_modules/css-loader!./css/app.css 288 bytes {0} [built]
+ 1 hidden module
Removing intermediate container 32d29ae825dc
---> 1652e757ce84
Step 10/14 : WORKDIR ..
Removing intermediate container 7105810b289c
---> 2b70ff76f567
Step 11/14 : RUN mix compile
---> Running in 24f323cf77ec
Compiling 14 files (.ex)
Generated dynt app
Removing intermediate container 24f323cf77ec
---> 1fa5e1391358
Step 12/14 : RUN mix phx.digest
---> Running in de1a1273b897
Check your digested files at "priv/static"
Removing intermediate container de1a1273b897
---> 10b4d9d7ef22
Step 13/14 : ENTRYPOINT ["mix"]
---> Running in fb2010aa40b0
Removing intermediate container fb2010aa40b0
---> 350cf12427b8
Step 14/14 : CMD ["release", "--env=prod"]
---> Running in 6d4233d6c02f
Removing intermediate container 6d4233d6c02f
---> 936b437e9636
Successfully built 936b437e9636
Successfully tagged dynt-build:latest
==> Assembling release..
==> Building release dynt:0.1.0 using environment prod
==> Including ERTS 9.3 from /usr/lib/erlang/erts-9.3
==> Packaging release..
==> Release successfully built!
You can run it in one of the following ways:
Interactive: _build/prod/rel/dynt/bin/dynt console
Foreground: _build/prod/rel/dynt/bin/dynt foreground
Daemon: _build/prod/rel/dynt/bin/dynt start
~/webapp/phx/1.4.0-dev/dynt (master ✔) ᐅ docker-compose up
Creating network "dynt_default" with the default driver
Pulling db (postgres:10.2-alpine)...
10.2-alpine: Pulling from library/postgres
ff3a5c916c92: Pull complete
a503b44e1ce0: Pull complete
211706713093: Pull complete
8df57d533e71: Pull complete
7858f71c02fb: Pull complete
55a8ef17ba59: Pull complete
3fb44f23d323: Pull complete
65cad41156b3: Pull complete
5492a5bead70: Pull complete
Digest: sha256:2cdf8430d7c1f59b3d3808f672944491aabf0fdf15da5b5e158e9fa4162453bf
Status: Downloaded newer image for postgres:10.2-alpine
Building admin
Step 1/5 : FROM bitwalker/alpine-erlang:20.3.2
20.3.2: Pulling from bitwalker/alpine-erlang
2fdfe1cd78c2: Already exists
9ebca238abc6: Pull complete
8b81f5dbc183: Pull complete
Digest: sha256:de3f1a537acbc9c6d920104369eb15b5043f7316d661785bf52987288b6aae54
Status: Downloaded newer image for bitwalker/alpine-erlang:20.3.2
---> d8328b810c7c
Step 2/5 : ENV MIX_ENV=prod
---> Running in ec0481fcecab
Removing intermediate container ec0481fcecab
---> e747f239daf1
Step 3/5 : ADD _build/prod/rel/dynt/releases/0.1.0/dynt.tar.gz ./
---> 3bf48ab9cd04
Step 4/5 : USER default
---> Running in 9ca64ec9b37f
Removing intermediate container 9ca64ec9b37f
---> d76fa20e8a32
Step 5/5 : ENTRYPOINT ["./bin/dynt"]
---> Running in 51e1d7be0ddf
Removing intermediate container 51e1d7be0ddf
---> c0b9843f2131
Successfully built c0b9843f2131
Successfully tagged dynt-release:latest
WARNING: Image for service admin was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating dynt-db ... done
Creating dynt-admin ... done
Creating dynt-server ... done
Attaching to dynt-db, dynt-admin, dynt-server
dynt-db | The files belonging to this database system will be owned by user "postgres".
dynt-db | This user must also own the server process.
dynt-db |
dynt-db | The database cluster will be initialized with locale "en_US.utf8".
dynt-db | The default database encoding has accordingly been set to "UTF8".
dynt-db | The default text search configuration will be set to "english".
dynt-db |
dynt-db | Data page checksums are disabled.
dynt-db |
dynt-db | fixing permissions on existing directory /var/lib/postgresql/data ... ok
dynt-db | creating subdirectories ... ok
dynt-db | selecting default max_connections ... 100
dynt-db | selecting default shared_buffers ... 128MB
dynt-db | selecting dynamic shared memory implementation ... posix
dynt-db | creating configuration files ... ok
dynt-db | running bootstrap script ... ok
dynt-db | performing post-bootstrap initialization ... sh: locale: not found
dynt-db | 2018-07-13 02:07:16.481 UTC [27] WARNING: no usable system locales were found
dynt-db | ok
dynt-db | syncing data to disk ... ok
dynt-db |
dynt-db | Success. You can now start the database server using:
dynt-db |
dynt-db | pg_ctl -D /var/lib/postgresql/data -l logfile start
dynt-db |
dynt-db |
dynt-db | WARNING: enabling "trust" authentication for local connections
dynt-db | You can change this by editing pg_hba.conf or using the option -A, or
dynt-db | --auth-local and --auth-host, the next time you run initdb.
dynt-db | waiting for server to start....2018-07-13 02:07:19.639 UTC [32] LOG: listening on IPv4 address "127.0.0.1", port 5432
dynt-db | 2018-07-13 02:07:19.639 UTC [32] LOG: could not bind IPv6 address "::1": Address not available
dynt-db | 2018-07-13 02:07:19.639 UTC [32] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
dynt-db | 2018-07-13 02:07:19.649 UTC [32] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
dynt-db | 2018-07-13 02:07:19.702 UTC [33] LOG: database system was shut down at 2018-07-13 02:07:17 UTC
dynt-db | 2018-07-13 02:07:19.717 UTC [32] LOG: database system is ready to accept connections
dynt-db | done
dynt-db | server started
dynt-db | CREATE DATABASE
dynt-db |
dynt-db | ALTER ROLE
dynt-db |
dynt-db |
dynt-db | /usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
dynt-db |
dynt-db | 2018-07-13 02:07:20.582 UTC [32] LOG: received fast shutdown request
dynt-db | waiting for server to shut down....2018-07-13 02:07:20.592 UTC [32] LOG: aborting any active transactions
dynt-db | 2018-07-13 02:07:20.598 UTC [32] LOG: worker process: logical replication launcher (PID 39) exited with exit code 1
dynt-db | 2018-07-13 02:07:20.599 UTC [34] LOG: shutting down
dynt-db | 2018-07-13 02:07:20.649 UTC [32] LOG: database system is shut down
dynt-db | done
dynt-db | server stopped
dynt-db |
dynt-db | PostgreSQL init process complete; ready for start up.
dynt-db |
dynt-db | 2018-07-13 02:07:20.699 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
dynt-db | 2018-07-13 02:07:20.700 UTC [1] LOG: listening on IPv6 address "::", port 5432
dynt-db | 2018-07-13 02:07:20.827 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
dynt-db | 2018-07-13 02:07:20.885 UTC [45] LOG: database system was shut down at 2018-07-13 02:07:20 UTC
dynt-db | 2018-07-13 02:07:20.927 UTC [1] LOG: database system is ready to accept connections
dynt-admin | Loading ..
dynt-admin | Starting dependencies..
dynt-admin | Starting repos..
dynt-admin | Running migrations for dynt
dynt-admin | 02:07:30.725 [info] Already up
dynt-admin | Running seed script..
dynt-admin | Success!
dynt-admin exited with code 0
^CGracefully stopping... (press Ctrl+C again to force)
Stopping dynt-server ... done
Stopping dynt-db ... done
~/webapp/phx/1.4.0-dev/dynt (master ✔) ᐅ docker logs dynt-server
02:09:39.013 [info] SIGTERM received - shutting down
~/webapp/phx/1.4.0-dev/dynt (master ✔) ᐅ docker logs dynt-admin
Loading ..
Starting dependencies..
Starting repos..
Running migrations for dynt
02:07:30.725 [info] Already up
Running seed script..
Success!
~/webapp/phx/1.4.0-dev/dynt (master ✔) ᐅ docker logs dynt-db
The files belonging to this database system will be owned by user "postgres".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.utf8".
The default database encoding has accordingly been set to "UTF8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /var/lib/postgresql/data ... ok
creating subdirectories ... ok
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... ok
sh: locale: not found
2018-07-13 02:07:16.481 UTC [27] WARNING: no usable system locales were found
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
Success. You can now start the database server using:
pg_ctl -D /var/lib/postgresql/data -l logfile start
WARNING: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
waiting for server to start....2018-07-13 02:07:19.639 UTC [32] LOG: listening on IPv4 address "127.0.0.1", port 5432
2018-07-13 02:07:19.639 UTC [32] LOG: could not bind IPv6 address "::1": Address not available
2018-07-13 02:07:19.639 UTC [32] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
2018-07-13 02:07:19.649 UTC [32] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-07-13 02:07:19.702 UTC [33] LOG: database system was shut down at 2018-07-13 02:07:17 UTC
2018-07-13 02:07:19.717 UTC [32] LOG: database system is ready to accept connections
done
server started
CREATE DATABASE
ALTER ROLE
/usr/local/bin/docker-entrypoint.sh: ignoring /docker-entrypoint-initdb.d/*
2018-07-13 02:07:20.582 UTC [32] LOG: received fast shutdown request
waiting for server to shut down....2018-07-13 02:07:20.592 UTC [32] LOG: aborting any active transactions
2018-07-13 02:07:20.598 UTC [32] LOG: worker process: logical replication launcher (PID 39) exited with exit code 1
2018-07-13 02:07:20.599 UTC [34] LOG: shutting down
2018-07-13 02:07:20.649 UTC [32] LOG: database system is shut down
done
server stopped
PostgreSQL init process complete; ready for start up.
2018-07-13 02:07:20.699 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432
2018-07-13 02:07:20.700 UTC [1] LOG: listening on IPv6 address "::", port 5432
2018-07-13 02:07:20.827 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-07-13 02:07:20.885 UTC [45] LOG: database system was shut down at 2018-07-13 02:07:20 UTC
2018-07-13 02:07:20.927 UTC [1] LOG: database system is ready to accept connections
2018-07-13 02:09:44.244 UTC [1] LOG: received smart shutdown request
2018-07-13 02:09:44.249 UTC [1] LOG: worker process: logical replication launcher (PID 51) exited with exit code 1
2018-07-13 02:09:44.249 UTC [46] LOG: shutting down
2018-07-13 02:09:44.294 UTC [1] LOG: database system is shut down
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment