-
Notifications
You must be signed in to change notification settings - Fork 44
/
Dockerfile
38 lines (21 loc) · 869 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
FROM "elixir:1.14-slim"
ARG MIX_ENV=dev
ENV MIX_ENV=$MIX_ENV
WORKDIR /code
RUN apt-get update && apt-get -y install cargo python procps autoconf libtool libgmp3-dev git curl make build-essential && \
curl https://get.volta.sh | bash
ENV PATH=$PATH:/root/.volta/bin
RUN volta install [email protected]
ADD ["package.json", "package-lock.json", "/code/"]
RUN npm install
ADD ["mix.lock", "mix.exs", "/code/"]
RUN echo "y" | mix local.hex --if-missing && echo "y" | mix local.rebar --if-missing
RUN mix deps.get && MIX_ENV=test mix deps.compile && \
MIX_ENV=$MIX_ENV mix deps.compile && MIX_ENV=prod mix deps.compile
ADD ["config", "lib", "/code/"]
RUN MIX_ENV=$MIX_ENV mix compile
ADD ["test", "/code/"]
RUN MIX_ENV=test mix compile && MIX_ENV=$MIX_ENV mix compile
ADD . /code/
RUN MIX_ENV=test mix compile && MIX_ENV=$MIX_ENV mix compile
CMD ["/bin/bash"]