Skip to content

Instantly share code, notes, and snippets.

@tobyhede
Created November 20, 2015 03:37
Show Gist options
  • Save tobyhede/d0d87b64bb9b9c65ec00 to your computer and use it in GitHub Desktop.
Save tobyhede/d0d87b64bb9b9c65ec00 to your computer and use it in GitHub Desktop.

Revisions

  1. tobyhede created this gist Nov 20, 2015.
    43 changes: 43 additions & 0 deletions Dockerfile
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    FROM ubuntu:14.04.3

    MAINTAINER Toby Hede <>

    ENV ELIXIR_VERSION 1.1.1
    ENV PORT 80
    ENV MIX_ENV prod

    # Elixir requires UTF-8
    RUN locale-gen en_US.UTF-8
    ENV LANG en_US.UTF-8
    ENV LANGUAGE en_US:en
    ENV LC_ALL en_US.UTF-8

    EXPOSE 80

    # update and install some software requirements
    RUN apt-get update && apt-get upgrade -y && apt-get install -y build-essential git wget

    # download and install Erlang package
    RUN wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \
    && dpkg -i erlang-solutions_1.0_all.deb \
    && apt-get update

    # install erlang from package
    RUN apt-get install -y erlang erlang-ssl erlang-inets && rm erlang-solutions_1.0_all.deb

    # install elixir from source
    RUN git clone https://github.com/elixir-lang/elixir.git && cd elixir && git checkout v$ELIXIR_VERSION && make
    ENV PATH $PATH:/elixir/bin

    # install mix
    RUN /elixir/bin/mix local.hex --force && /elixir/bin/mix local.rebar --force && mix hex.info

    COPY ./ app

    WORKDIR /app

    # RUN mix deps.get

    RUN mix phoenix.digest && mix release

    CMD rel/$APP/bin/$APP foreground