-
Notifications
You must be signed in to change notification settings - Fork 6
/
Dockerfile
41 lines (28 loc) · 781 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
FROM elixir:1.9.4-alpine AS build
WORKDIR /app
ADD config/config.exs config/
ADD config/prod.exs config/
ADD config/prod.secret.exs config/
RUN apk add --update git build-base nodejs yarn python npm
ENV MIX_ENV=prod
ADD mix.exs mix.lock ./
RUN mix do local.hex --force, local.rebar --force, deps.get, deps.compile
ADD assets assets/
RUN cd assets && \
npm install && \
npm run deploy
RUN mix phx.digest
ADD priv priv/
ADD lib lib/
ADD rel rel/
RUN mix compile && \
mix release
#######################################
FROM alpine:3.10
RUN apk add --update bash openssl
WORKDIR /app
COPY --from=build /app/_build/prod/rel/markdown_live ./
RUN chown -R nobody: /app
USER nobody
ADD docker/default.md /default.md
CMD ["/app/bin/markdown_live", "start"]