forked from happyteamio/elkarmo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
58 lines (43 loc) · 1.32 KB
/
Dockerfile
File metadata and controls
58 lines (43 loc) · 1.32 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
54
55
56
57
58
FROM elixir:1.6-slim as builder
RUN apt-get update && apt-get install -y --no-install-recommends \
locales \
&& export LANG=en_US.UTF-8 \
&& echo $LANG UTF-8 > /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=$LANG \
&& rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8
ENV MIX_ENV=prod
# Install Hex+Rebar
RUN mix local.hex --force && \
mix local.rebar --force
WORKDIR /opt/elkarmo
# Cache elixir deps so that they won't be rebuilt if deps haven't changed
RUN mkdir config
COPY config/* config/
COPY mix.exs mix.lock ./
RUN mix do deps.get, deps.compile
COPY . .
RUN mix release --env=prod --verbose --no-tar
FROM debian:9.4
RUN apt-get update && apt-get install -y --no-install-recommends \
locales \
libssl1.1 \
&& export LANG=en_US.UTF-8 \
&& echo $LANG UTF-8 > /etc/locale.gen \
&& locale-gen \
&& update-locale LANG=$LANG \
&& rm -rf /var/lib/apt/lists/*
ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
LC_ALL=en_US.UTF-8 \
REPLACE_OS_VARS=true \
ERLANG_COOKIE=default_cookie \
ELKARMO_SLACK_TOKEN=slack_token
COPY --from=builder /opt/elkarmo/_build/prod/rel/elkarmo /opt/elkarmo
RUN mkdir /opt/elkarmo/data
VOLUME ["/opt/elkarmo/data"]
ENTRYPOINT ["/opt/elkarmo/bin/elkarmo"]
CMD ["foreground"]