FROM elixir:1.4.5-slim

ENV MIX_ENV=prod
ENV PORT=4000
ENV ALLOWED_ORIGINS=example.com

RUN mix local.hex --force
RUN mix local.rebar --force

RUN apt-get update -y

RUN mkdir /usr/src/app
WORKDIR /usr/src/app
COPY . .

RUN mix deps.get --only prod  
RUN mix compile

EXPOSE 4000

CMD ["/bin/bash", "docker-entrypoint.sh"]
