forked from Blockstream/esplora
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
48 lines (36 loc) · 1.58 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
FROM blockstream/esplora-base:latest AS build
FROM debian:buster@sha256:41f76363fd83982e14f7644486e1fb04812b3894aa4e396137c3435eaf05de88
COPY --from=build /srv/explorer /srv/explorer
COPY --from=build /root/.nvm /root/.nvm
RUN apt-get -yqq update \
&& apt-get -yqq upgrade \
&& apt-get -yqq install nginx libnginx-mod-http-lua tor git curl runit procps socat gpg
RUN mkdir -p /srv/explorer/static
COPY ./ /srv/explorer/source
ARG FOOT_HTML
WORKDIR /srv/explorer/source
SHELL ["/bin/bash", "-c"]
# required to run some scripts as root (needed for docker)
RUN source /root/.nvm/nvm.sh \
&& npm config set unsafe-perm true \
&& npm install && (cd prerender-server && npm run dist) \
&& DEST=/srv/explorer/static/bitcoin-mainnet \
npm run dist -- bitcoin-mainnet \
&& DEST=/srv/explorer/static/bitcoin-testnet \
npm run dist -- bitcoin-testnet \
&& DEST=/srv/explorer/static/liquid-mainnet \
npm run dist -- liquid-mainnet \
&& DEST=/srv/explorer/static/bitcoin-mainnet-blockstream \
npm run dist -- bitcoin-mainnet blockstream \
&& DEST=/srv/explorer/static/bitcoin-testnet-blockstream \
npm run dist -- bitcoin-testnet blockstream \
&& DEST=/srv/explorer/static/liquid-mainnet-blockstream \
npm run dist -- liquid-mainnet blockstream
# configuration
RUN cp /srv/explorer/source/run.sh /srv/explorer/
# cleanup
RUN apt-get --auto-remove remove -yqq --purge manpages \
&& apt-get clean \
&& apt-get autoclean \
&& rm -rf /usr/share/doc* /usr/share/man /usr/share/postgresql/*/man /var/lib/apt/lists/* /var/cache/* /tmp/* /root/.cache /*.deb /root/.cargo
WORKDIR /srv/explorer