-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.vaxine
94 lines (69 loc) · 2.53 KB
/
Dockerfile.vaxine
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
ARG ELIXIR_VERSION=1.13.4
ARG OTP_VERSION=24.3
ARG DEBIAN_VERSION=bullseye-20210902-slim
ARG BUILDER_IMAGE="hexpm/elixir:${ELIXIR_VERSION}-erlang-${OTP_VERSION}-debian-${DEBIAN_VERSION}"
ARG RUNNER_IMAGE="debian:${DEBIAN_VERSION}"
FROM ${BUILDER_IMAGE} AS builder
LABEL maintainer="[email protected]"
RUN apt-get update -y && apt-get install -y build-essential git curl \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
RUN mix local.hex --force
RUN mix local.rebar --force
ENV PATH="/root/.mix/:${PATH}"
WORKDIR /app
ENV CI=true
COPY rebar.config /app/
COPY rebar.lock /app/
RUN rebar3 compile
COPY Makefile /app/
COPY config/ /app/config/
COPY apps/ /app/apps/
RUN make rel
FROM ${RUNNER_IMAGE} AS runner_setup
RUN apt-get update -y && apt-get install -y libstdc++6 openssl libncurses5 locales \
&& apt-get clean && rm -f /var/lib/apt/lists/*_*
# Set the locale
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && locale-gen
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
WORKDIR "/app"
RUN chown nobody /app
# set runner ENV
ENV MIX_ENV="prod"
FROM runner_setup AS runner
## Vaxine configuration via environment variables
COPY --from=builder --chown=nobody:root /app/_build/default/rel/vaxine ./
COPY entrypoint.sh /
### Data storage
# where the logs and data are stored and exposed
ENV ROOT_DIR_PREFIX="/vaxine-data/" \
DATA_DIR_PREFIX="data/" \
LOGGER_DIR_PREFIX="log/"
ENV \
### Riak
HANDOFF_PORT="8099" \
RING_SIZE="16" \
### Inter-DC communication
LOGREADER_PORT="8085" \
PBSUB_PORT="8086" \
ANTIDOTE_PB_PORT="8087" \
VAXINE_PB_PORT="8088" \
### Erlang
NODE_NAME="antidote@antidote" \
COOKIE="secret"\
### Logger verbosity: debug, info, notice, warning, error, alert, critical
DEBUG_LOGGER_LEVEL="info"
EXPOSE ${LOGREADER_PORT} ${PBSUB_PORT} ${ANTIDOTE_PB_PORT} ${VAXINE_PB_PORT} ${HANDOFF_PORT}
## Antidote Features Configuration
## Adjusting features for a node restart can have unexpected consequences
## Decide on features before first starting and operating the AntidoteDB node
## see config/sys.config.src for documentation
ENV ANTIDOTE_TXN_CERT="true" \
ANTIDOTE_TXN_PROT="clocksi" \
ANTIDOTE_RECOVER_FROM_LOG="true" \
ANTIDOTE_META_DATA_ON_START="true" \
ANTIDOTE_SYNC_LOG="false" \
ANTIDOTE_ENABLE_LOGGING="true" \
ANTIDOTE_AUTO_START_READ_SERVERS="true"
ENTRYPOINT /entrypoint.sh