Skip to content

Instantly share code, notes, and snippets.

@MrCoffey
Last active November 26, 2016 02:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MrCoffey/fff0556fa62131f726355b514704ce3b to your computer and use it in GitHub Desktop.
Save MrCoffey/fff0556fa62131f726355b514704ce3b to your computer and use it in GitHub Desktop.
# Sets the Docker image that will be used as a base.
FROM trenpixster/elixir:1.3.0
# Compiles app
RUN mkdir /app
WORKDIR /app
ENV MIX_ENV prod
# Injects AWS env variables explained below
ENV HOST_VARS inject_here
# Installs all the Elixir Dependencies
ADD mix.* ./
RUN mix local.rebar
RUN mix local.hex --force
RUN mix deps.get
# Installs the app
ADD . .
RUN prod mix compile
# Exposes this port from the docker container to the host machine
EXPOSE 4000
# Migrate the database
CMD mix ecto.migrate
# Starts the phoenix server
CMD mix phoenix.server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment