-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
164 lines (130 loc) · 5.12 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
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
ARG RAIDEN_VERSION="v3.0.1"
ARG CONTRACTS_PACKAGE_VERSION="0.40.3"
ARG CONTRACTS_VERSION="0.40.0"
ARG SERVICES_VERSION="v1.0.0"
ARG SYNAPSE_VERSION="v1.35.1"
ARG RAIDEN_SYNAPSE_MODULES="0.1.3"
ARG OS_NAME="LINUX"
ARG GETH_VERSION="1.10.20"
ARG GETH_URL_LINUX="https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.10.20-8f2416a8.tar.gz"
ARG GETH_MD5_LINUX="d1793b47659cb6b1bb753b6bae2792bb"
FROM xq310/raiden-base as raiden-builder
ARG RAIDEN_VERSION
# clone raiden repo + install dependencies
RUN git clone -b develop https://github.com/XuHugo/raiden /app/raiden
RUN python3 -m venv /opt/raiden
ENV PATH="/opt/raiden/bin:$PATH"
WORKDIR /app/raiden
RUN git checkout op
#RUN pip install raiden-contracts==0.40.0
RUN pip install pip==21.2.4
RUN apt-get update
RUN apt-get install -y python3-dev
RUN apt-get install -y pkg-config
RUN apt-get install -y libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
RUN make install
FROM xq310/raiden-base as synapse-builder
RUN python -m venv /synapse-venv && /synapse-venv/bin/pip install wheel
ARG SYNAPSE_VERSION
ARG RAIDEN_SYNAPSE_MODULES
RUN /synapse-venv/bin/pip install \
"matrix-synapse[postgres,redis]==${SYNAPSE_VERSION}" \
"jinja2<3.1.0" \
psycopg2 \
coincurve \
pycryptodome \
"twisted>=20.3.0" \
click==7.1.2 \
docker-py \
raiden-synapse-modules==${RAIDEN_SYNAPSE_MODULES}
# XXX Temporary hot-patch while https://github.com/matrix-org/synapse/pull/9820 is not released yet -- note: this should
# be run in in workerless setup
RUN sed -i 's/\(\s*\)if self.worker_type/\1if True or self.worker_type/' /synapse-venv/lib/python3.9/site-packages/raiden_synapse_modules/pfs_presence_router.py
COPY synapse/auth/ /synapse-venv/lib/python3.9/site-packages/
FROM xq310/raiden-base
LABEL maintainer="Raiden Network Team <[email protected]>"
ARG OS_NAME
ARG GETH_URL_LINUX
ARG GETH_MD5_LINUX
ARG CONTRACTS_VERSION
ARG CONTRACTS_PACKAGE_VERSION
ARG GETH_VERSION
RUN apt-get update \
&& apt-get install -y --no-install-recommends supervisor python3-virtualenv libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
ENV SERVER_NAME="localhost:9080"
ENV PASSWORD_FILE=/opt/passwd
ENV PASSWORD=1234
RUN echo ${PASSWORD} > ${PASSWORD_FILE}
COPY setup/ /usr/local/bin
# prepare raiden
COPY --from=raiden-builder /opt/raiden /opt/raiden
COPY raiden/ /opt/raiden/config/
# Download GETH
ARG DEPLOYMENT_DIRECTORY=/opt/deployment
ARG VENV=/opt/raiden
ARG SMARTCONTRACTS_ENV_FILE=/etc/profile.d/smartcontracts.sh
COPY geth/* /usr/local/bin/
ARG LOCAL_BASE=/usr/local
ARG DATA_DIR=/opt/chain
RUN download_geth.sh && deploy.sh \
&& cp -R /opt/deployment/* ${VENV}/lib/python3.9/site-packages/raiden_contracts/data_${CONTRACTS_VERSION}/
RUN mkdir -p /opt/synapse/config \
&& mkdir -p /opt/synapse/data_well_known \
&& mkdir -p /opt/synapse/venv/ \
&& mkdir -p /var/log/supervisor
COPY synapse/synapse.template.yaml /opt/synapse/config/
COPY synapse/exec/ /usr/local/bin/
COPY --from=synapse-builder /synapse-venv /opt/synapse/venv
# Services
ARG SERVICES_VERSION
WORKDIR /opt/services
RUN git clone https://github.com/raiden-network/raiden-services.git
WORKDIR /opt/services/raiden-services
RUN git checkout "${SERVICES_VERSION}"
#RUN apt-get update \
# && apt-get install -y --no-install-recommends python3-dev \
# FIXME: why use the system 3.7 here?
# &&
RUN /usr/bin/python3 -m virtualenv -p python3.9 /opt/services/venv
RUN pip install pip==21.2.4
RUN apt-get update
RUN apt-get install -y python3-dev
RUN apt-get install -y pkg-config
RUN apt-get install -y libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev libswscale-dev libswresample-dev libavfilter-dev
RUN /opt/services/venv/bin/pip install -U pip wheel \
&& /opt/services/venv/bin/pip install -r requirements.txt \
&& /opt/services/venv/bin/pip install -e . \
&& mkdir -p /opt/services/keystore
RUN cp -R ${VENV}/lib/python3.9/site-packages/raiden_contracts/data_${CONTRACTS_VERSION}/* /opt/services/venv/lib/python3.9/site-packages/raiden_contracts/data \
&& rm -rf ~/.cache/pip \
&& apt-get -y remove python3-dev \
&& apt-get -y autoremove \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*
ENV DEPLOYMENT_INFO=/opt/deployment/deployment_private_net.json
ENV DEPLOYMENT_SERVICES_INFO=/opt/deployment/deployment_services_private_net.json
COPY services/keystore/UTC--2020-03-11T15-39-16.935381228Z--2b5e1928c25c5a326dbb61fc9713876dd2904e34 /opt/services/keystore
ENV ETH_RPC="http://localhost:8545"
RUN setup_channels.sh
## GETH
EXPOSE 8545 8546 8547 30303 30303/udp
## PFS
EXPOSE 5555
## RAIDEN
# HTTP
EXPOSE 5001 5002 5003 5004 5005 5006 5007 5008 5009 5010
## MATRIX
# HTTP
EXPOSE 9080
# HTTP metrics
EXPOSE 9101
# TCP replication
EXPOSE 9092
# HTTP replication
EXPOSE 9093
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# In order to preserve the entrypoint for CicleCI https://circleci.com/docs/2.0/custom-images/#adding-an-entrypoint
LABEL com.circleci.preserve-entrypoint=true
ENTRYPOINT ["entrypoint.sh"]