-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathContainerfile
92 lines (63 loc) · 2.13 KB
/
Containerfile
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
ARG package
FROM docker.io/library/rust:latest AS compiled-base
ENV CARGO_INCREMENTAL="0"
RUN ["apt-get", "update"]
RUN ["apt-get", "upgrade", "--purge", "--yes"]
RUN ["apt-get", "install", "--yes", "libc6-dev"]
WORKDIR "/code/"
FROM scratch AS service-base
VOLUME ["/service/logs/"]
WORKDIR "/service/"
ENTRYPOINT ["/service/service"]
ENV ADMIN_CONTRACT_ADDRESS="###"
ENV BALANCE_REPORTER_IDLE_DURATION_SECONDS="600"
ENV BROADCAST_DELAY_DURATION_SECONDS="2"
ENV BROADCAST_RETRY_DELAY_DURATION_MILLISECONDS="500"
ENV FEE_TOKEN_DENOM="unls"
ENV GAS_FEE_CONF__GAS_ADJUSTMENT_NUMERATOR="12"
ENV GAS_FEE_CONF__GAS_ADJUSTMENT_DENOMINATOR="10"
ENV GAS_FEE_CONF__GAS_PRICE_NUMERATOR="1"
ENV GAS_FEE_CONF__GAS_PRICE_DENOMINATOR="400"
ENV GAS_FEE_CONF__FEE_ADJUSTMENT_NUMERATOR="5"
ENV GAS_FEE_CONF__FEE_ADJUSTMENT_DENOMINATOR="1"
ENV IDLE_DURATION_SECONDS="60"
ENV LOGS_DIRECTORY="/service/logs/"
ENV NODE_GRPC_URI="###"
ENV OUTPUT_JSON="0"
ENV SIGNING_KEY_MNEMONIC="###"
ENV TIMEOUT_DURATION_SECONDS="60"
FROM service-base AS alarms-dispatcher-base
ENV PRICE_ALARMS_GAS_LIMIT_PER_ALARM="500000"
ENV PRICE_ALARMS_MAX_ALARMS_GROUP="32"
ENV TIME_ALARMS_GAS_LIMIT_PER_ALARM="500000"
ENV TIME_ALARMS_MAX_ALARMS_GROUP="32"
FROM service-base AS market-data-feeder-base
ENV DURATION_BEFORE_START="600"
ENV GAS_LIMIT="###"
ENV UPDATE_CURRENCIES_INTERVAL_SECONDS="15"
FROM compiled-base AS compiled
ARG package
LABEL "package"="${package:?}"
ARG profile
LABEL "profile"="${profile:?}"
COPY --chown="0":"0" --chmod="0555" "." "/code/"
RUN "cargo" \
"rustc" \
"--bin" "${package:?}" \
"--locked" \
"--manifest-path" "/code/services/${package:?}/Cargo.toml" \
"--package" "${package:?}" \
"--profile" "${profile:?}" \
"--target" "x86_64-unknown-linux-gnu" \
"--target-dir" "/build-output/" \
"--" \
"-C" "target-feature=+crt-static"
FROM ${package}-base AS service
ARG package
LABEL "package"="${package:?}"
ARG profile
LABEL "profile"="${profile:?}"
ARG profile_output_dir
COPY --from=compiled --chown="0":"0" --chmod="0100" \
"/build-output/x86_64-unknown-linux-gnu/${profile_output_dir:?}/${package:?}" \
"/service/service"