Last active
November 2, 2020 18:22
-
-
Save tiagopog/c46534cbd99eeee9bbb44c9542868911 to your computer and use it in GitHub Desktop.
Elixir – Dockerfiles
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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