-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
46 lines (32 loc) · 823 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
FROM elixir:1.9.1-alpine as build
# install build dependencies
RUN apk add --update git build-base
ENV MIX_ENV prod
ENV APP_HOME /app
RUN mix do local.hex --force, local.rebar --force
# Create app folder
RUN mkdir -p $APP_HOME
WORKDIR $APP_HOME
COPY . /app
# Clone account core dependency
RUN git submodule update --init --recursive
# Install dependencies
RUN mix deps.get
# Compile all dependencies
RUN mix deps.compile
# Compile the entire project
RUN mix compile
# build release (uncomment COPY if rel/ exists)
# COPY rel rel
RUN mix release
# prepare release image
FROM alpine:3.9 AS app
RUN apk add --update bash openssl
RUN mkdir /app
WORKDIR /app
COPY --from=build /app/_build/prod/rel/account_api ./
RUN chown -R nobody: /app
USER nobody
ENV HOME=/app
EXPOSE 4000
CMD ["/app/bin/account_api", "start"]