Skip to content

Instantly share code, notes, and snippets.

@tiagopog
Last active November 2, 2020 18:22
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 tiagopog/c46534cbd99eeee9bbb44c9542868911 to your computer and use it in GitHub Desktop.
Save tiagopog/c46534cbd99eeee9bbb44c9542868911 to your computer and use it in GitHub Desktop.
Elixir – Dockerfiles
FROM elixir:1.10.4
##
# Install system dependencies & tooling
##
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get install -y bash curl apt-utils build-essential inotify-tools
ENV DEBIAN_FRONTEND noninteractive
##
# Set development environment
##
ENV MIX_ENV=dev
ENV APP_DIR=/opt/app
ENV SERVER_PORT=4000
WORKDIR ${APP_DIR}
##
# Install app dependencies
##
COPY mix.* ./
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix archive.install --force hex phx_new 1.5.6
RUN mix do deps.get, deps.compile
##
# Main
##
COPY . .
RUN mix compile
EXPOSE ${SERVER_PORT}
FROM elixir:1.10.4
##
# Install system dependencies & tooling
##
RUN apt-get update
RUN apt-get -y upgrade
RUN apt-get install -y bash apt-utils build-essential inotify-tools
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get -y install nodejs
ENV DEBIAN_FRONTEND noninteractive
##
# Set development environment
##
ENV MIX_ENV=dev
ENV APP_DIR=/opt/app
ENV SERVER_PORT=4000
WORKDIR ${APP_DIR}
##
# Install app dependencies
##
COPY mix.* ./
RUN mix local.hex --force
RUN mix local.rebar --force
RUN mix archive.install --force hex phx_new 1.5.6
RUN mix do deps.get, deps.compile
##
# Main
##
COPY . .
RUN mix compile
EXPOSE ${SERVER_PORT}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment