-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
51 lines (34 loc) · 962 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
47
48
49
50
ARG ERLANG_IMAGE
ARG ELIXIR_IMAGE
#########################
###### Build Image ######
#########################
FROM --platform=$BUILDPLATFORM ${ELIXIR_IMAGE} as builder
ENV MIX_ENV=prod \
MIX_HOME=/opt/mix \
HEX_HOME=/opt/hex
RUN mix local.hex --force && \
mix local.rebar --force
WORKDIR /app
COPY mix.lock mix.exs ./
COPY config config
RUN mix deps.get --only-prod && \
mix deps.clean --unused && \
mix deps.compile
# COPY priv priv
COPY lib lib
RUN mix release
#########################
##### Release Image #####
#########################
FROM --platform=$BUILDPLATFORM ${ERLANG_IMAGE}
# elixir expects utf8.
ENV LANG=C.UTF-8
WORKDIR /opt/kompost
COPY --from=builder /app/_build/prod/rel/kompost ./
RUN chmod g+rwX /opt/kompost
LABEL org.opencontainers.image.source="https://github.com/mruoss/kompost"
LABEL org.opencontainers.image.authors="[email protected]"
USER 1001
ENTRYPOINT ["/opt/kompost/bin/kompost"]
CMD ["start"]