mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 10:28:10 +01:00
Start isolated docker setup.
This commit is contained in:
1
docker/production/.env
Normal file
1
docker/production/.env
Normal file
@@ -0,0 +1 @@
|
||||
HTML_PORT=127.0.0.1:12700:12700
|
||||
26
docker/production/bitcoin/Dockerfile
Normal file
26
docker/production/bitcoin/Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
# https://github.com/NicolasDorier/docker-bitcoin/blob/master/README.md
|
||||
|
||||
FROM i_swapclient as install_stage
|
||||
|
||||
RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=bitcoin --withoutcoins=particl,litecoin
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=install_stage /coin_bin .
|
||||
|
||||
ENV BITCOIN_DATA /data
|
||||
|
||||
RUN groupadd -r bitcoin && useradd -r -m -g bitcoin bitcoin \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends gosu \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir "$BITCOIN_DATA" \
|
||||
&& chown -R bitcoin:bitcoin "$BITCOIN_DATA" \
|
||||
&& ln -sfn "$BITCOIN_DATA" /home/bitcoin/.bitcoin \
|
||||
&& chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
VOLUME /data
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["bitcoind"]
|
||||
11
docker/production/bitcoin/entrypoint.sh
Executable file
11
docker/production/bitcoin/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "bitcoin-cli" || "$1" == "bitcoin-tx" || "$1" == "bitcoind" || "$1" == "test_bitcoin" ]]; then
|
||||
mkdir -p "$BITCOIN_DATA"
|
||||
|
||||
chown -h bitcoin:bitcoin /home/bitcoin/.bitcoin
|
||||
exec gosu bitcoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
70
docker/production/docker-compose.yml
Normal file
70
docker/production/docker-compose.yml
Normal file
@@ -0,0 +1,70 @@
|
||||
version: '3.3'
|
||||
|
||||
services:
|
||||
particl_core:
|
||||
image: i_particl
|
||||
build:
|
||||
context: particl
|
||||
dockerfile: Dockerfile
|
||||
container_name: particl_core
|
||||
volumes:
|
||||
- /var/swapdata/particl:/data
|
||||
ports:
|
||||
- "51738:51738"
|
||||
expose:
|
||||
- 51735
|
||||
restart: unless-stopped
|
||||
bitcoin_core:
|
||||
image: i_bitcoin
|
||||
build:
|
||||
context: bitcoin
|
||||
dockerfile: Dockerfile
|
||||
container_name: bitcoin_core
|
||||
volumes:
|
||||
- /var/swapdata/bitcoin:/data
|
||||
ports:
|
||||
- "8333:8333"
|
||||
expose:
|
||||
- 8332
|
||||
restart: unless-stopped
|
||||
#monero_daemon:
|
||||
#image: i_monero_daemon
|
||||
#build:
|
||||
#context: monero_daemon
|
||||
#dockerfile: Dockerfile
|
||||
#container_name: monero_daemon
|
||||
#volumes:
|
||||
#- /var/swapdata/monero_daemon:/data
|
||||
#ports:
|
||||
#- "18080:18080"
|
||||
#expose:
|
||||
#- 8332
|
||||
#restart: unless-stopped
|
||||
monero_wallet:
|
||||
image: i_monero_wallet
|
||||
build:
|
||||
context: monero_wallet
|
||||
dockerfile: Dockerfile
|
||||
container_name: monero_wallet
|
||||
volumes:
|
||||
- /var/swapdata/monero_wallet:/data
|
||||
expose:
|
||||
- 8332
|
||||
restart: unless-stopped
|
||||
swapclient:
|
||||
image: i_swapclient
|
||||
build:
|
||||
context: swapclient
|
||||
dockerfile: Dockerfile
|
||||
container_name: swapclient
|
||||
volumes:
|
||||
- /var/swapdata/swapclient:/data
|
||||
ports:
|
||||
- "${HTML_PORT}" # Expose only to localhost, see .env
|
||||
depends_on:
|
||||
- particl_core
|
||||
restart: unless-stopped
|
||||
networks:
|
||||
default:
|
||||
external:
|
||||
name: coinswap_network
|
||||
24
docker/production/litecoin/Dockerfile
Normal file
24
docker/production/litecoin/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM i_swapclient as install_stage
|
||||
|
||||
RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=litecoin --withoutcoin=particl
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=install_stage /coin_bin .
|
||||
|
||||
ENV LITECOIN_DATA /data
|
||||
|
||||
RUN groupadd -r particl && useradd -r -m -g litecoin litecoin \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends gosu \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir "$LITECOIN_DATA" \
|
||||
&& chown -R litecoin:litecoin "$LITECOIN_DATA" \
|
||||
&& ln -sfn "$LITECOIN_DATA" /home/litecoin/.litecoin \
|
||||
&& chown -h litecoin:litecoin /home/litecoin/.litecoin
|
||||
VOLUME /data
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 8332 8333 18332 18333 18443 18444
|
||||
CMD ["litecoind"]
|
||||
11
docker/production/litecoin/entrypoint.sh
Executable file
11
docker/production/litecoin/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "litecoin-cli" || "$1" == "litecoin-tx" || "$1" == "litecoind" || "$1" == "test_litecoin" ]]; then
|
||||
mkdir -p "$LITECOIN_DATA"
|
||||
|
||||
chown -h litecoin:litecoin /home/litecoin/.litecoin
|
||||
exec gosu litecoin "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
25
docker/production/monero_daemon/Dockerfile
Normal file
25
docker/production/monero_daemon/Dockerfile
Normal file
@@ -0,0 +1,25 @@
|
||||
FROM i_swapclient as install_stage
|
||||
|
||||
RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=monero --withoutcoins=particl,litecoin
|
||||
|
||||
FROM debian:buster-slim
|
||||
|
||||
COPY --from=install_stage /coin_bin .
|
||||
|
||||
ENV MONERO_DATA /data
|
||||
|
||||
RUN groupadd -r monero && useradd -r -m -g monero monero \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends gosu \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p "$MONERO_DATA" \
|
||||
&& chown -R monero:monero "$MONERO_DATA" \
|
||||
&& ln -sfn "$MONERO_DATA" /home/monero/.monero \
|
||||
&& chown -h monero:monero /home/monero/.monero
|
||||
VOLUME $MONERO_DATA
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 18080
|
||||
CMD ["monerod", "--config-file=/home/monero/.monero/monerod.conf"]
|
||||
11
docker/production/monero_daemon/entrypoint.sh
Executable file
11
docker/production/monero_daemon/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "monerod" ]]; then
|
||||
mkdir -p "$MONERO_DATA"
|
||||
|
||||
chown -h monero:monero /home/monero/.monero
|
||||
exec gosu monero "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
19
docker/production/monero_wallet/Dockerfile
Normal file
19
docker/production/monero_wallet/Dockerfile
Normal file
@@ -0,0 +1,19 @@
|
||||
FROM i_monero_daemon
|
||||
|
||||
ENV MONERO_DATA /data
|
||||
|
||||
RUN groupadd -r monero && useradd -r -m -g monero monero \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends gosu \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p "$MONERO_DATA" \
|
||||
&& chown -R monero:monero "$MONERO_DATA" \
|
||||
&& ln -sfn "$MONERO_DATA" /home/monero/.monero \
|
||||
&& chown -h monero:monero /home/monero/.monero
|
||||
VOLUME $MONERO_DATA
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 18080
|
||||
CMD ["monero-wallet-rpc", "--config-file=/home/monero/.monero/monerod.conf"]
|
||||
11
docker/production/monero_wallet/entrypoint.sh
Executable file
11
docker/production/monero_wallet/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "monerod" ]]; then
|
||||
mkdir -p "$MONERO_DATA"
|
||||
|
||||
chown -h monero:monero /home/monero/.monero
|
||||
exec gosu monero "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
24
docker/production/particl/Dockerfile
Normal file
24
docker/production/particl/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM i_swapclient as install_stage
|
||||
|
||||
RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=particl --withoutcoin=litecoin
|
||||
|
||||
FROM debian:buster-slim
|
||||
COPY --from=install_stage /coin_bin .
|
||||
|
||||
ENV PARTICL_DATA /data
|
||||
|
||||
RUN groupadd -r particl && useradd -r -m -g particl particl \
|
||||
&& apt-get update \
|
||||
&& apt-get install -qq --no-install-recommends gosu \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& mkdir -p "$PARTICL_DATA" \
|
||||
&& chown -R particl:particl "$PARTICL_DATA" \
|
||||
&& ln -sfn "$PARTICL_DATA" /home/particl/.particl \
|
||||
&& chown -h particl:particl /home/particl/.particl
|
||||
VOLUME /data
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
|
||||
EXPOSE 51735 20792 51738
|
||||
CMD ["particld"]
|
||||
11
docker/production/particl/entrypoint.sh
Executable file
11
docker/production/particl/entrypoint.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
if [[ "$1" == "particl-cli" || "$1" == "particl-tx" || "$1" == "particld" || "$1" == "test_particl" ]]; then
|
||||
mkdir -p "$PARTICL_DATA"
|
||||
|
||||
chown -h particl:particl /home/particl/.particl
|
||||
exec gosu particl "$@"
|
||||
else
|
||||
exec "$@"
|
||||
fi
|
||||
32
docker/production/swapclient/Dockerfile
Normal file
32
docker/production/swapclient/Dockerfile
Normal file
@@ -0,0 +1,32 @@
|
||||
FROM debian:buster-slim
|
||||
|
||||
ENV LANG=C.UTF-8 \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
DATADIR=/data
|
||||
|
||||
RUN apt-get update; \
|
||||
apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config gosu;
|
||||
|
||||
RUN wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/anonswap.zip && \
|
||||
unzip coincurve-anonswap.zip && \
|
||||
cd coincurve-anonswap && \
|
||||
python3 setup.py install --force
|
||||
|
||||
RUN wget -O basicswap-master.zip https://github.com/tecnovert/basicswap/archive/master.zip; \
|
||||
unzip basicswap-master.zip; \
|
||||
cd basicswap-master; \
|
||||
protoc -I=basicswap --python_out=basicswap basicswap/messages.proto; \
|
||||
pip3 install .;
|
||||
|
||||
RUN useradd -ms /bin/bash swap_user && \
|
||||
mkdir /data && chown swap_user -R /data
|
||||
|
||||
# Expose html port
|
||||
EXPOSE 12700
|
||||
|
||||
VOLUME /data
|
||||
|
||||
COPY ./entrypoint.sh /entrypoint.sh
|
||||
|
||||
ENTRYPOINT ["/entrypoint.sh"]
|
||||
CMD ["basicswap-run", "-datadir=/data"]
|
||||
6
docker/production/swapclient/entrypoint.sh
Executable file
6
docker/production/swapclient/entrypoint.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
chown -R swap_user "$DATADIR"
|
||||
exec gosu swap_user "$@"
|
||||
|
||||
Reference in New Issue
Block a user