Created
May 13, 2017 22:08
-
-
Save auser/ea613a4ca76eb2f53a4208620cb3372a to your computer and use it in GitHub Desktop.
Dockerfile for elixir development
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM elixir:1.4.2 | |
ENV PORT=4000 MIX_ENV=prod | |
ENV APP_NAME=myapp APP_VERSION="0.1.0" | |
RUN mix local.hex --force && \ | |
mix local.rebar --force && \ | |
mkdir /build | |
WORKDIR /build | |
COPY ./mix.exs /build | |
COPY ./mix.lock /build | |
COPY ./config /build/config | |
RUN mix do deps.get, deps.compile | |
COPY . /build | |
RUN mix do compile, release --verbose | |
# ADD _build/prod/rel/$APP_NAME . | |
RUN ln -s /build/_build/prod/rel/$APP_NAME /$APP_NAME | |
EXPOSE $PORT | |
WORKDIR /$APP_NAME | |
CMD trap exit TERM; /$APP_NAME/bin/$APP_NAME foreground & wait |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment