forked from CirclesUBI/safe-relay-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
54 lines (42 loc) · 1.55 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
FROM python:3.9-slim
ENV PYTHONUNBUFFERED 1
ENV TINI_VERSION v0.19.0
# https://eth-hash.readthedocs.io/en/latest/quickstart.html#specify-backend-by-environment-variable
# `pysha3` is way faster than `pycryptodome` for CPython
ENV ETH_HASH_BACKEND=pysha3
# Signal handling for PID1 https://github.com/krallin/tini
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
# Create man folders which are required by postgres
RUN for i in {1..8}; do mkdir -p "/usr/share/man/man$i"; done
# Install postgres-client
RUN apt-get update \
&& apt-get install -y git postgresql-client libpq-dev libxml2-dev libxslt-dev python-dev zlib1g-dev
WORKDIR safe-relay-service
# Install Safe relay service
COPY . .
# Install Safe relay service dependencies
RUN set -ex \
&& buildDeps=" \
build-essential \
libssl-dev \
libgmp-dev \
pkg-config \
" \
&& apt-get install -y --no-install-recommends $buildDeps tmux \
&& pip install -U --no-cache-dir wheel setuptools pip \
&& pip install --no-cache-dir -r requirements.txt \
&& apt-get purge -y --auto-remove $buildDeps \
&& rm -rf /var/lib/apt/lists/* \
&& find /usr/local \
\( -type d -a -name test -o -name tests \) \
-o \( -type f -a -name '*.pyc' -o -name '*.pyo' \) \
-exec rm -rf '{}' +
RUN pip check
# Copy runtime scripts into root
COPY scripts/run.sh .
COPY scripts/run-worker.sh .
COPY scripts/run-scheduler.sh .
COPY scripts/wait-for-db.sh .
EXPOSE 8888
ENTRYPOINT ["./wait-for-db.sh", "/tini", "--"]