Last active
February 26, 2017 19:04
-
-
Save klausmeyer/22ef10461f07d45fd880d129f778c30c to your computer and use it in GitHub Desktop.
Dockerfile which can be used for Phoenix applications
This file contains hidden or 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 | |
MAINTAINER Klaus Meyer <[email protected]> | |
ENV PORT 8080 | |
ENV MIX_ENV prod | |
RUN useradd -m -d /app app | |
ADD . /app | |
RUN chown -R app:app /app | |
EXPOSE $PORT | |
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash - && \ | |
apt-get install -y nodejs && \ | |
rm -rf /var/lib/apt/lists/* | |
USER app | |
WORKDIR /app | |
RUN mix local.hex --force && \ | |
mix local.rebar --force && \ | |
mix deps.get --only-prod && \ | |
mix compile && \ | |
mix phoenix.digest | |
CMD ["mix", "phoenix.server"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment