forked from monero-project/monero
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
69 lines (51 loc) · 1.79 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
# syntax=docker/dockerfile:1
FROM lthn/build:compile as builder
ARG IMG_PREFIX=lthn
ARG THREADS=2
ARG TARGET=x86_64-unknown-linux-gnu
WORKDIR /build
COPY . .
COPY --from=lthn/build:depends-x86_64-unknown-linux-gnu / /build/contrib/depends
RUN set -ex && \
git submodule init && git submodule update &&
make -j$(nproc) depends target=x86_64-unknown-linux-gnu
# runtime stage
FROM debian:bullseye as container
RUN adduser --system --group --disabled-password itw3 && \
mkdir -p /wallet /home/itw3 && \
chown -R itw3:itw3 /home/itw3 && \
chown -R itw3:itw3 /wallet
RUN set -ex && \
apt-get update && \
apt-get --no-install-recommends --yes install ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt
COPY --from=builder --chmod=0777 --chown=itw3:itw3 /build/**/${BRANCH}/release/bin/ /usr/local/bin/
# Create iTw3 user
RUN adduser --system --group --disabled-password itw3 && \
mkdir -p /home/itw3/wallet && \
chown -R itw3:itw3 /home/itw3/wallet
# iTw3 User Folder
VOLUME /home/itw3
VOLUME /home/itw3/wallet
ENV LOG_LEVEL 0
# switch to user monero
USER itw3
# P2P live + testnet
ENV P2P_BIND_IP 0.0.0.0
ENV P2P_BIND_PORT 48772
ENV TEST_P2P_BIND_PORT 38772
# RPC live + testnet
ENV RPC_BIND_IP 0.0.0.0
ENV RPC_BIND_PORT 48782
ENV TEST_RPC_BIND_PORT 38782
ENV DATA_DIR /home/itw3/data
ENV TEST_DATA_DIR /home/itw3/data/testnet
RUN mkdir -p ${TEST_DATA_DIR}
EXPOSE 48782
EXPOSE 48772
EXPOSE 38772
EXPOSE 38782
ENTRYPOINT ["itw3d", "--confirm-external-bind", "--log-level=${LOG_LEVEL}","--data-dir=${DATA_DIR}", "--testnet-data-dir=${TEST_DATA_DIR}",\
"--rpc-bind-ip=${RPC_BIND_IP}","--p2p-bind-ip=${P2P_BIND_IP}","--p2p-bind-port=${P2P_BIND_PORT}", "--testnet-p2p-bind-port=${TEST_P2P_BIND_PORT}",\
"--rpc-bind-port=${RPC_BIND_PORT}", "--testnet-rpc-bind-port=${TEST_RPC_BIND_PORT}"]