-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
61 lines (42 loc) · 1.63 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
# Build Service Node
FROM debian:buster-slim as bitcoin-node-builder
RUN mkdir -p /app \
&& chown -R nobody:nogroup /app
WORKDIR /app
ENV DEBIAN_FRONTEND noninteractive
RUN apt update \
&& apt install -y wget
ENV ARCH=x86_64
ENV BITCOIN_VERSION=22.0
RUN wget https://bitcoin.org/bin/bitcoin-core-$BITCOIN_VERSION/bitcoin-$BITCOIN_VERSION-$ARCH-linux-gnu.tar.gz \
&& tar -xf bitcoin-$BITCOIN_VERSION-$ARCH-linux-gnu.tar.gz \
&& cp -R bitcoin-$BITCOIN_VERSION/bin/bitcoind /app/node-runner
# Build bitcoin Rosetta Mentat
FROM debian:buster-slim as rosetta-mentat-builder
ARG BRANCH="main"
RUN mkdir -p /app \
&& chown -R nobody:nogroup /app
WORKDIR /app
ENV DEBIAN_FRONTEND noninteractive
RUN apt-get update && apt-get install -y curl clang git pkg-config libssl-dev
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH=/root/.cargo/bin:$PATH
RUN git clone -b $BRANCH https://github.com/monadicus/rosetta-bitcoin.git \
&& cd rosetta-bitcoin \
&& cargo build --profile release-docker \
&& mv ./target/release-docker/rosetta-bitcoin /app/server \
&& mv ./docker.conf.toml /app/conf.toml
## Build Final Image
FROM debian:buster-slim
ENV ROCKET_ENV "production"
RUN apt-get update && apt-get install -y libssl-dev
RUN mkdir -p /app/data \
&& chown -R nobody:nogroup /app
WORKDIR /app
# Copy binary from bitcoin-node-builder
COPY --from=bitcoin-node-builder /app/node-runner /app/node-runner
# Copy binary from rosetta-bitcoin-server
COPY --from=rosetta-mentat-builder /app/* /app
# Set permissions for everything added to /app
RUN chmod -R 755 /app/*
CMD ["/app/server", "./conf.toml"]