-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.litecoind.txt
176 lines (153 loc) · 5.89 KB
/
Dockerfile.litecoind.txt
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
FROM ubuntu-upstart:latest
MAINTAINER SachiO
RUN rm -rf /usr/sbin/policy-rc.d
ADD policy-rc.d /usr/sbin/policy-rc.d
RUN chmod +x /usr/sbin/policy-rc.d
ADD litecoind /bin/litecoind
RUN chmod +x /bin/litecoind
RUN mkdir /root/.litecoin \
&& mkdir /root/.litecoin/testnet3
ADD litecoin.conf /root/.litecoin/litecoin.conf
ADD wallet.dat /root/.litecoin/testnet3/wallet.dat
ENV APACHE_RUN_USER="www-data" \
APACHE_RUN_GROUP="www-data" \
APACHE_PID_FILE="/var/run/apache2.pid" \
APACHE_RUN_DIR="/var/run/apache2" \
APACHE_LOCK_DIR="/var/lock/apache2" \
APACHE_LOG_DIR="/var/log/apache2" \
APACHE_USER_UID="0" \
DEBIAN_FRONTEND="noninteractive"
RUN apt-get update -qq \
&& apt-get install -y apt-utils perl --no-install-recommends
RUN dpkg-divert --local --rename --add /sbin/initctl \
&& ln -s /bin/true /sbin/initctl
RUN apt-get install -y software-properties-common \
&& apt-get install -y software-properties-common python-software-properties \
&& apt-get -y update \
&& apt-get -y upgrade \
&& apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 4F4EA0AAE5267A6C \
# && gpg -a --export 4F4EA0AAE5267A6C \
# && apt-key add - \
&& add-apt-repository ppa:jonathonf/python-3.6 \
&& apt-get -y update \
&& apt-get install -y python3.6 \
&& add-apt-repository ppa:ondrej/php \
&& apt-get -y update \
&& apt-get -y upgrade \
&& apt-cache policy php5.6 \
&& apt-get install -y libapache2-mod-php5 \
php5-memcached \
php5-mysqlnd \
php5-curl \
php5-json \
&& apt-get install -qqy --force-yes \
build-essential \
apache2 \
cron \
pwgen \
supervisor \
curl \
openssh-server \
libboost-all-dev \
libcurl4-openssl-dev \
libdb5.3-dev \
libdb5.3++-dev \
git \
memcached \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get install -y mysql-server-5.5 \
&& apt install -y mysql-server \
mysql-client
RUN python -V
RUN wget https://bootstrap.pypa.io/get-pip.py \
# && python get-pip.py
&& python3 get-pip.py
RUN apt-get install -y python3-pip
# RUN apt-get install -y python-pip
RUN python -V \
&& rm /usr/bin/python \
&& ln -s /usr/bin/python3.6 /usr/bin/python \
&& python -V \
&& ln -s /usr/bin/pip3 /usr/bin/pip
RUN pip install -U distribute \
&& rm -rf /etc/apache2/apache2.conf
ADD apache2.conf /etc/apache2/apache2.conf
ADD apache_default /etc/apache2/sites-available/000-default.conf
RUN cd /var/www \
&& git clone git://github.com/MPOS/php-mpos.git mpos \
&& cd mpos \
&& python -V \
&& git checkout master \
&& chown -R www-data templates/compile templates/cache logs \
&& cd /root \
&& python -V \
&& git clone https://github.com/ahmedbodi/stratum-mining.git \
&& cd /root/stratum-mining \
&& python -V \
&& git submodule init \
&& git submodule update \
&& cd /root/stratum-mining/externals/litecoin_scrypt \
&& python -V \
# && apt-get install -y python-dev \
&& apt-get install -y python3.6-dev \
# && export CPATH=:/usr/include/python2.7/ \
&& export CPATH=$CPATH:/usr/include/python3.6/ \
&& printenv \
&& python -V \
&& python setup.py install \
# && python setup.py install \
&& cd /root/stratum-mining/externals/stratum \
# && export CPATh=$CPATH:/usr/include/python2.7/ \
# && export CPATH=$CPATH:/usr/include/python3.6/ \
&& printenv \
&& python -V \
&& pip install --upgrade pip setuptools \
# && pip install ez-setup \
&& pip install distribute \
# && cat /root/stratum-mining/externals/stratum/distribute_setup.py \
# && sed -ri 's/http/https/g' /root/stratum-mining/externals/stratum/distribute_setup.py \
# && cat /root/stratum-mining/externals/stratum/setup.py \
&& wget https://pypi.python.org/packages/source/d/distribute/distribute-0.6.10.tar.gz \
&& tar -xzvf distribute-0.6.10.tar.gz \
&& cd distribute-0.6.10 \
&& ls -l \
&& python setup.py install \
&& python -V \
# && python setup.py install \
&& mkdir /root/stratum-mining/log
ADD config.py /root/stratum-mining/conf/config.py
ADD global.inc.php /var/www/mpos/include/config/global.inc.php
ADD start-apache2.sh /start-apache2.sh
ADD start-mysqld.sh /start-mysqld.sh
ADD start-cron.sh /start-cron.sh
ADD start-litecoind.sh /start-litecoind.sh
ADD start-stratum.sh /start-stratum.sh
ADD start-memcached.sh /start-memcached.sh
ADD run.sh /run.sh
RUN chmod 755 /*.sh
ADD my.cnf /etc/mysql/conf.d/my.cnf
ADD supervisord-apache2.conf /etc/supervisor/conf.d/supervisord-apache2.conf
ADD supervisord-mysqld.conf /etc/supervisor/conf.d/supervisord-mysqld.conf
ADD supervisord-cron.conf /etc/supervisor/conf.d/supervisord-cron.conf
ADD supervisord-litecoin.conf /etc/supervisor/conf.d/supervisord-litecoin.conf
ADD supervisord-stratum.conf /etc/supervisor/conf.d/supervisord-stratum.conf
ADD supervisord-memcached.conf /etc/supervisor/conf.d/supervisord-memcached.conf
ADD cron /etc/cron.d/cron
RUN chmod 0644 /etc/cron.d/cron \
&& chmod +x /etc/cron.d/cron \
&& rm -rf /var/lib/mysql/*
ADD create_mysql_admin_user.sh /create_mysql_admin_user.sh
RUN chmod 755 /*.sh
RUN a2enmod rewrite \
&& service apache2 restart
ENV PHP_UPLOAD_MAX_FILESIZE="10M" \
PHP_POST_MAX_SIZE="10M"
# RUN mkdir /var/run/sshd
RUN echo 'root:root' |chpasswd \
&& sed -ri 's/^PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config \
&& sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config \
&& ls -l /usr/local/lib/python2.7/dist-packages/
# && sed -ri 's/from autobahn.websocket import WebSocketServerProtocol, WebSocketServerFactory/from autobahn.twisted.websocket import WebSocketServerProtocol, WebSocketServerFactory/g' /usr/local/lib/python2.7/dist-packages/stratum-0.2.13-py2.7.egg/stratum/websocket_transport.py
ADD supervisord-openssh-server.conf /etc/supervisor/conf.d/supervisord-openssh-server.conf
EXPOSE 80 443 3306 22 3333
CMD ["/run.sh"]