-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
50 lines (30 loc) · 835 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
49
50
FROM elixir:alpine AS elixir
RUN mix local.hex --force && mix local.rebar --force
RUN apk update
RUN apk add git nodejs npm inotify-tools bash curl tar xz
ARG MIX_ENV=prod
WORKDIR /app
COPY mix.exs mix.exs
COPY mix.lock mix.lock
RUN mix deps.get
COPY config config
RUN mix deps.compile
COPY . .
RUN mix compile
# BREAK
FROM elixir:alpine AS javascript
RUN apk update
RUN apk add git nodejs npm inotify-tools bash curl tar xz
COPY --from=elixir /app/assets /app/assets
COPY --from=elixir /app/deps /app/deps
WORKDIR /app/assets
RUN npm install
RUN npm run deploy
# BREAK
FROM elixir:alpine
RUN mix local.hex --force && mix local.rebar --force
RUN apk update
RUN apk add git nodejs npm inotify-tools bash curl tar xz
WORKDIR /app
COPY --from=elixir /app /app
COPY --from=javascript /app/priv/static/ /app/priv/static