Skip to content

Instantly share code, notes, and snippets.

@idyll
Created March 15, 2017 15:09
Show Gist options
  • Save idyll/194150211044511a8176423ddcc9aa7b to your computer and use it in GitHub Desktop.
Save idyll/194150211044511a8176423ddcc9aa7b to your computer and use it in GitHub Desktop.
Elixir Dockerfile
FROM trenpixster/elixir:1.4.1
MAINTAINER Mark Madsen <mm@idyll.io>
RUN curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
RUN apt-get update
RUN apt-get install -y libssl1.0.0 openssl apt libgcrypt11 libxml2 openssh-client libc6 gnupg dpkg openssh-sftp-server apt-utils apt-transport-https libpcre3 curl gcc-4.9-base gpgv libapt-inst1.5 libapt-pkg4.12 libc-bin libcurl3 libcurl3-gnutls libexpat1 libgcc1 libk5crypto3 libpng12-0 tzdata multiarch-support
RUN apt-get update --fix-missing
RUN apt-get install -y build-essential nodejs imagemagick
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
EXPOSE 4000
ADD . /app
WORKDIR /app
RUN mix clean
RUN mix local.hex --force
RUN mix local.rebar --force
RUN MIX_ENV=prod mix deps.get --only prod
RUN MIX_ENV=prod mix compile
RUN npm install
RUN npm rebuild node-sass
RUN node node_modules/brunch/bin/brunch build
RUN MIX_ENV=prod mix phoenix.digest
CMD PORT=4000 MIX_ENV=prod mix ecto.migrate && mix phoenix.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment