-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
53 lines (40 loc) · 1.06 KB
/
Copy pathDockerfile
File metadata and controls
53 lines (40 loc) · 1.06 KB
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
51
52
53
FROM grapevinehaus/elixir:1.9.4-alpine-1 as builder
# The nuclear approach:
# RUN apk add --no-cache alpine-sdk
RUN apk add --no-cache \
gcc \
git \
make \
musl-dev
RUN mix local.rebar --force && \
mix local.hex --force
WORKDIR /app
ENV MIX_ENV=prod
COPY mix.* /app/
RUN mix deps.get --only prod
RUN mix deps.compile
FROM node:10.9 as frontend
WORKDIR /app
COPY assets/package*.json /app/
COPY --from=builder /app/deps/phoenix /deps/phoenix
COPY --from=builder /app/deps/phoenix_html /deps/phoenix_html
RUN npm install -g yarn && yarn install
COPY assets /app
RUN npm run deploy
FROM builder as releaser
COPY --from=frontend /priv/static /app/priv/static
COPY . /app/
RUN mix deps.clean mime --build && \
mix deps.compile mime && \
mix deps.get && \
mix phx.digest && \
mix release
FROM alpine:3.11
RUN apk add -U bash libssl1.1
WORKDIR /app
COPY --from=releaser /app/_build/prod/rel/ex_venture /app/
COPY config/prod.docker.exs /etc/exventure.config.exs
EXPOSE 4000 5555 5556
VOLUME /var/log/ex_venture/
ENTRYPOINT ["bin/ex_venture"]
CMD ["start"]