forked from guydavis/machinaris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
119 lines (107 loc) · 2.6 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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# set ubuntu release version
ARG UBUNTU_VER="focal"
######## packages stage ###########
FROM ubuntu:${UBUNTU_VER} as package_stage
ARG DEBIAN_FRONTEND=noninteractive
# install build packages
RUN \
apt-get update \
&& apt-get install -y \
acl \
ansible \
apt \
bash \
bc \
build-essential \
ca-certificates \
curl \
git \
jq \
nfs-common \
openssl \
python3 \
python3.8-distutils \
python3.8-venv \
python3-dev \
python3-pip \
python-is-python3 \
sqlite3 \
sudo \
tar \
tzdata \
unzip \
vim \
wget \
cmake \
rsync \
\
# cleanup apt cache
\
&& rm -rf \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
######## build/runtime stage #########
FROM package_stage
# Base install of official Chia binaries at the given branch
ARG CHIA_BRANCH
ARG PATCH_CHIAPOS
# copy local files
COPY . /machinaris/
# set workdir
WORKDIR /chia-blockchain
# install Chia using official Chia Blockchain binaries
RUN \
git clone --branch ${CHIA_BRANCH} --single-branch https://github.com/Chia-Network/chia-blockchain.git /chia-blockchain \
&& git submodule update --init mozilla-ca \
&& chmod +x install.sh \
&& /usr/bin/sh ./install.sh \
\
# cleanup apt and pip caches
\
&& rm -rf \
/root/.cache \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# install additional tools such as Plotman, Chiadog, and Machinaris
RUN \
/usr/bin/bash /machinaris/scripts/patch_chiapos.sh ${PATCH_CHIAPOS} \
&& . /machinaris/scripts/chiadog_install.sh \
&& . /machinaris/scripts/plotman_install.sh \
&& . /machinaris/scripts/machinaris_install.sh \
\
# cleanup apt and pip caches
\
&& rm -rf \
/root/.cache \
/tmp/* \
/var/lib/apt/lists/* \
/var/tmp/*
# Provide a colon-separated list of in-container paths to your mnemonic keys
ENV keys="/root/.chia/mnemonic.txt"
# Provide a colon-separated list of in-container paths to your completed plots
ENV plots_dir="/plots"
# One of fullnode, plotter, farmer, or harvester. Default is fullnode
ENV mode="fullnode"
# If mode=plotter, optional 2 public keys will be set in your plotman.yaml
ENV farmer_pk="null"
ENV pool_pk="null"
# If mode=harvester, required for host and port the harvester will your farmer
ENV farmer_address="null"
ENV farmer_port="8447"
# Only set true if using Chia's old test for testing only, default uses mainnet
ENV testnet="false"
ENV PATH="${PATH}:/chia-blockchain/venv/bin"
ENV TZ=Etc/UTC
ENV FLASK_ENV=production
ENV FLASK_APP=/machinaris/main.py
ENV XDG_CONFIG_HOME=/root/.chia
ENV AUTO_PLOT=false
VOLUME [ "/id_rsa" ]
# ports
EXPOSE 8555
EXPOSE 8444
EXPOSE 8926
WORKDIR /chia-blockchain
ENTRYPOINT ["bash", "./entrypoint.sh"]