-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
36 lines (26 loc) · 791 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
FROM bitwalker/alpine-erlang:6.1
ENV HOME=/opt/app/ TERM=xterm
# Install Elixir and basic build dependencies
RUN \
echo "@edge http://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \
apk update && \
apk --no-cache --update add \
git make g++ nodejs python \
elixir@edge && \
rm -rf /var/cache/apk/*
# Install Hex+Rebar
RUN mix local.hex --force && \
mix local.rebar --force
WORKDIR /opt/app
ENV MIX_ENV=prod REPLACE_OS_VARS=true SHELL=/bin/sh
# Cache elixir deps
COPY config/ ./config/
COPY mix.exs mix.lock ./
RUN mix do deps.get, deps.compile, compile
# Cache node deps
COPY client/ ./client/
RUN npm install --prefix client/
COPY . .
RUN npm run build --prefix client/
RUN rm -r client/
RUN mix release --env=prod --verbose