-
Notifications
You must be signed in to change notification settings - Fork 13
/
Dockerfile.l1
50 lines (47 loc) · 2.02 KB
/
Dockerfile.l1
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
FROM sidhujag/syscoin-core:latest as syscoin-alpine
FROM alpine:3.15
ARG SENTINEL_REPO=https://github.com/syscoin/sentinel.git
RUN apk add --no-cache gcc musl-dev linux-headers git python3 py-virtualenv rust
RUN git clone ${SENTINEL_REPO}
RUN cd sentinel && virtualenv -p $(which python3) venv
RUN cd sentinel && venv/bin/python -m pip install --upgrade pip
RUN cd sentinel && venv/bin/pip install -r requirements.txt
RUN cd sentinel && chmod +x bin/sentinel.py
#write out current crontab
RUN crontab -l > mycron
#echo new cron into cron file
RUN echo "* * * * * cd /sentinel && ./venv/bin/python bin/sentinel.py 2>&1 >> sentinel-cron.log" >> mycron
#install new cron file
RUN crontab mycron
RUN rm mycron
ENV HOME=/home
RUN apk add --no-cache jq
ENV RPC_PORT="${RPC_PORT:-8545}"
ENV SYSCOIN_DATA=/home/syscoin/.syscoin
ENV SYSCOIN_PREFIX=/opt/syscoin
COPY --from=syscoin-alpine ${SYSCOIN_PREFIX}/bin/syscoind /usr/local/bin/syscoind
COPY --from=syscoin-alpine ${SYSCOIN_PREFIX}/bin/syscoin-cli /usr/local/bin/syscoin-cli
COPY --from=syscoin-alpine ${SYSCOIN_PREFIX}/bin/sysgeth /usr/local/bin/sysgeth
RUN apk --no-cache add \
boost-filesystem \
boost-system \
boost-thread \
libevent \
libzmq \
su-exec \
ca-certificates \
gmp \
sqlite-dev
RUN echo $'cd sentinel && nohup venv/bin/python bin/sentinel.py --server &' >> sys.sh
RUN echo $'mkdir -p ${SYSCOIN_DATA}/testnet3/geth/keystore/' >> sys.sh
RUN echo $'/usr/sbin/crond' >> sys.sh
RUN echo $'syscoind --testnet --addnode=3.143.67.237 --datadir=${SYSCOIN_DATA} --disablewallet \
--gethcommandline=--http \
--gethcommandline=--http.corsdomain="*" \
--gethcommandline=--http.vhosts="*" \
--gethcommandline=--http.addr=0.0.0.0 \
--gethcommandline=--http.port="$RPC_PORT" \
--gethcommandline=--http.api=web3,debug,eth,txpool,net,engine \
--gethcommandline=--exitwhensynced' >> sys.sh
RUN echo $'exec syscoind --testnet --addnode=3.143.67.237 --datadir=${SYSCOIN_DATA} --disablewallet --rpcuser=u --rpcpassword=p --server=1 --rpcallowip=127.0.0.1' >> sys.sh
ENTRYPOINT ["/bin/sh", "sys.sh"]