-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
42 lines (29 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
FROM elixir:1.10-alpine as build
# prepare build dir
WORKDIR /pontinho
# install hex + rebar
RUN mix local.hex --force && \
mix local.rebar --force
# install build dependencies
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache build-base zip git
# set build ENV
ENV MIX_ENV=prod
# install mix dependencies and build project
COPY mix.exs mix.lock ./
COPY config config
COPY apps apps
RUN mix do deps.get, deps.compile, compile
# build release
RUN mix release --overwrite
RUN cd /pontinho/_build/prod/rel/web; zip --quiet -r /pontinho/pontinho.zip *
# prepare release image
FROM alpine:latest AS app
WORKDIR /pontinho
RUN apk update && \
apk upgrade --no-cache && \
apk add --no-cache ncurses unzip
COPY --from=build /pontinho/pontinho.zip ./
RUN unzip -q pontinho.zip
CMD /pontinho/bin/web start