-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
58 lines (46 loc) · 1.61 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
# This will build the currently checked out version
#
# we use an intermediate image to build this image. it will make the resulting
# image a bit smaller.
#
# you can build the image with:
#
# docker build . -t relay
FROM ubuntu:18.04 as builder
# python needs LANG
ENV LANG C.UTF-8
RUN apt-get update && \
apt-get install -y software-properties-common && \
add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get update && \
apt-get install -y apt-utils libssl-dev curl libsecp256k1-dev pkg-config \
python3.8 python3.8-distutils python3.8-dev python3-venv python3.8-venv git build-essential libpq-dev \
&& rm -rf /var/lib/apt/lists/*
RUN whoami
# Get Rust
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
RUN rustup default nightly
RUN python3.8 -m venv /opt/relay
RUN /opt/relay/bin/pip install -U pip wheel setuptools
WORKDIR /relay
COPY ./dev-requirements.txt /relay/dev-requirements.txt
COPY ./requirements.txt /relay/requirements.txt
RUN /opt/relay/bin/pip install --disable-pip-version-check -r requirements.txt
COPY . /relay
RUN /opt/relay/bin/pip install --disable-pip-version-check .
FROM ubuntu:18.04 as runner
ENV LANG C.UTF-8
RUN apt-get -y update
RUN apt-get install -y software-properties-common
RUN add-apt-repository -y ppa:deadsnakes/ppa && \
apt-get -y update && \
apt-get install -y apt-utils libssl-dev curl libpq5 libsecp256k1-0 \
python3.8 \
&& rm -rf /var/lib/apt/lists/* \
&& ln -s /opt/relay/bin/tl-relay /usr/local/bin/
FROM runner
COPY --from=builder /opt/relay /opt/relay
WORKDIR /opt/relay
EXPOSE 5000
ENTRYPOINT ["tl-relay"]