Skip to content

Instantly share code, notes, and snippets.

@KamilLelonek
Created July 22, 2017 19:40
Show Gist options
  • Save KamilLelonek/1c87016799752f44ff51a3145bf35afc to your computer and use it in GitHub Desktop.
Save KamilLelonek/1c87016799752f44ff51a3145bf35afc to your computer and use it in GitHub Desktop.
Elixir Dockerfile
# Latest version of Erlang-based Elixir installation: https://hub.docker.com/_/elixir/
FROM elixir:latest
# Create and set home directory
WORKDIR /opt/your_application_name
# Configure required environment
ENV MIX_ENV prod
# Install hex (Elixir package manager)
RUN mix local.hex --force
# Install rebar (Erlang build tool)
RUN mix local.rebar --force
# Copy all dependencies files
COPY mix.* ./
# Install all production dependencies
RUN mix deps.get --only prod
# Compile all dependencies
RUN mix deps.compile
# Copy all application files
COPY . .
# Compile the entire project
RUN mix compile
# Run the application itself
CMD ./scripts/docker.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment