Sign inSign up

19hz/phoenix

By 19hz

Updated almost 11 years ago

Node.js + Phoenix

Image
0

908

19hz/phoenix repository overview

Image Contents

This image is based on 19hz/elixir and includes the features of that image.

At the time of writing, this Dockerfile results in an image that also contains:

  • NodeJS >= v4.1.1. (installed via nodejs.org/dist/node-latest.tar.gz)
  • npm >= v2.14.4

It also includes the following ONBUILD steps for convenience of use as a base image itself:

  • Creates a working directory for your app at /usr/src/app
  • Adds files like package.json and brunch-config.js and installs npm dependencies
  • Sets MIX_ENV to prod
  • Copies files needed to determine Mix config and dependencies, then downloads and compiles those dependencies

All of the above occur before any custom instructions in a child Dockerfile that uses FROM to inherit from this one.

Expected phoenix app's prod.secret.exs file.

You can run your phoenix docker container with ENV vars.

config :mugen, Mugen.Endpoint,
  secret_key_base: System.get_env("SECRET_KEY_BASE")

# Configure your database
config :mugen, Mugen.Repo,
  adapter: Ecto.Adapters.Postgres,
  url: System.get_env("DATABASE_URL"),
  pool_size: System.get_env("DB_POOL_SIZE")

Checking Versions

Want to check the current versions included in the latest image in light of future rebuilds?

  • docker run -it --rm shanesveller/elixir-lang apt-cache policy nodejs

Caveats

  • MIX_ENV is set to prod globally for all commands run in the Docker container, unless overridden on a per-command basis or a later ENV Dockerfile instruction
  • When building your own apps based on a third party's Docker image, you should make note of any ONBUILD instructions in the base image's Dockerfile, as these are executed dynamically while building your app, prior to ANY of the instructions in your own Dockerfile.

Alternative images

Not happy with the Dockerfile steps? Having compatibility problems? Try one of these alternatives:

Tag summary

Content type

Image

Digest

sha256:b2410537f

Size

389.9 MB

Last updated

almost 11 years ago

docker pull 19hz/phoenix