-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
48 lines (33 loc) · 1002 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
39
40
41
42
43
44
45
46
47
48
FROM elixir:1.12
MAINTAINER Marcel Klehr <[email protected]>
RUN mix local.hex --force \
&& mix archive.install hex phx_new \
&& apt-get update \
&& curl -sL https://deb.nodesource.com/setup_14.x | bash \
&& apt-get install -y apt-utils \
&& apt-get install -y nodejs \
&& apt-get install -y build-essential \
&& apt-get install -y inotify-tools \
&& mix local.rebar --force
# Similar to cd
WORKDIR /app
COPY app/assets assets
RUN cd assets \
&& npm install \
&& npm run deploy
COPY app/priv priv
ENV MIX_ENV="prod"
COPY app/mix.exs app/mix.lock ./
RUN mix deps.get --only $MIX_ENV
RUN mkdir config
# copy compile-time config files before we compile dependencies
# to ensure any relevant config change will trigger the dependencies
# to be re-compiled.
COPY app/config/config.exs app/config/${MIX_ENV}.exs config/
RUN mix deps.compile
COPY app/lib lib
COPY app/config/releases.exs config/
COPY app/rel rel
ADD entrypoint.sh /
EXPOSE 4000
CMD ["/bin/bash", "/entrypoint.sh"]