Skip to content

Instantly share code, notes, and snippets.

@klausmeyer
Last active February 26, 2017 19:04
Show Gist options
  • Save klausmeyer/22ef10461f07d45fd880d129f778c30c to your computer and use it in GitHub Desktop.
Save klausmeyer/22ef10461f07d45fd880d129f778c30c to your computer and use it in GitHub Desktop.
Dockerfile which can be used for Phoenix applications
FROM elixir:1.4.2
MAINTAINER Klaus Meyer <spam@klaus-meyer.net>
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