-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
96 lines (74 loc) · 2.57 KB
/
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
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
95
96
FROM golang:1.21 as base
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
# copy the source code
COPY app ./app
COPY eth ./eth
COPY pokt ./pokt
COPY models ./models
COPY main.go ./
COPY defaults.yml ./
# build
RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/validator
# set environment variables
# mongodb
ENV MONGODB_URI ${MONGODB_URI}
ENV MONGODB_DATABASE ${MONGODB_DATABASE}
ENV MONGODB_TIMEOUT_SECS ${MONGODB_TIMEOUT_SECS}
# ethereum
ENV ETH_PRIVATE_KEY ${ETH_PRIVATE_KEY}
ENV ETH_RPC_URL ${ETH_RPC_URL}
ENV ETH_CHAIN_ID ${ETH_CHAIN_ID}
ENV ETH_START_BLOCK_NUMBER ${ETH_START_BLOCK_NUMBER}
ENV ETH_CONFIRMATIONS ${ETH_CONFIRMATIONS}
ENV ETH_RPC_TIMEOUT_SECS ${ETH_RPC_TIMEOUT_SECS}
ENV ETH_WRAPPED_POCKET_ADDRESS ${ETH_WRAPPED_POCKET_ADDRESS}
ENV ETH_MINT_CONTROLLER_ADDRESS ${ETH_MINT_CONTROLLER_ADDRESS}
ENV ETH_VALIDATOR_ADDRESSES ${ETH_VALIDATOR_ADDRESSES}
# pocket
ENV POKT_PRIVATE_KEY ${POKT_PRIVATE_KEY}
ENV POKT_RPC_URL ${POKT_RPC_URL}
ENV POKT_CHAIN_ID ${POKT_CHAIN_ID}
ENV POKT_START_HEIGHT ${POKT_START_HEIGHT}
ENV POKT_CONFIRMATIONS ${POKT_CONFIRMATIONS}
ENV POKT_RPC_TIMEOUT_SECS ${POKT_RPC_TIMEOUT_SECS}
ENV POKT_TX_FEE ${POKT_TX_FEE}
ENV POKT_VAULT_ADDRESS ${POKT_VAULT_ADDRESS}
ENV POKT_MULTISIG_PUBLIC_KEYS ${POKT_MULTISIG_PUBLIC_KEYS}
# google secret manager
ENV GOOGLE_SECRET_MANAGER_ENABLED ${GOOGLE_SECRET_MANAGER_ENABLED}
ENV GOOGLE_MONGO_SECRET_NAME ${GOOGLE_MONGO_SECRET_NAME}
ENV GOOGLE_POKT_SECRET_NAME ${GOOGLE_POKT_SECRET_NAME}
ENV GOOGLE_ETH_SECRET_NAME ${GOOGLE_ETH_SECRET_NAME}
# mint monitor
ENV MINT_MONITOR_ENABLED ${MINT_MONITOR_ENABLED}
ENV MINT_MONITOR_INTERVAL_SECS ${MINT_MONITOR_INTERVAL_SECS}
# mint signer
ENV MINT_SIGNER_ENABLED ${MINT_SIGNER_ENABLED}
ENV MINT_SIGNER_INTERVAL_SECS ${MINT_SIGNER_INTERVAL_SECS}
# mint executor
ENV MINT_EXECUTOR_ENABLED ${MINT_EXECUTOR_ENABLED}
ENV MINT_EXECUTOR_INTERVAL_SECS ${MINT_EXECUTOR_INTERVAL_SECS}
# burn monitor
ENV BURN_MONITOR_ENABLED ${BURN_MONITOR_ENABLED}
ENV BURN_MONITOR_INTERVAL_SECS ${BURN_MONITOR_INTERVAL_SECS}
# burn signer
ENV BURN_SIGNER_ENABLED ${BURN_SIGNER_ENABLED}
ENV BURN_SIGNER_INTERVAL_SECS ${BURN_SIGNER_INTERVAL_SECS}
# burn executor
ENV BURN_EXECUTOR_ENABLED ${BURN_EXECUTOR_ENABLED}
ENV BURN_EXECUTOR_INTERVAL_SECS ${BURN_EXECUTOR_INTERVAL_SECS}
# health check
ENV HEALTH_CHECK_INTERVAL_SECS ${HEALTH_CHECK_INTERVAL_SECS}
# logging
ENV LOG_LEVEL ${LOG_LEVEL}
# create app user
RUN adduser --group --system app
RUN chown -R app:app /bin/validator
RUN chmod +x /bin/validator
RUN chown -R app:app /app
# switch to app user
USER app
# run
CMD ["/bin/validator", "--config", "/app/defaults.yml"]