2021-10-20 19:57:11 +00:00
|
|
|
version: "3"
|
|
|
|
services:
|
|
|
|
db:
|
|
|
|
container_name: db
|
2024-03-13 14:04:09 +00:00
|
|
|
build: ./docker/db
|
|
|
|
restart: unless-stopped
|
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "PGPASSWORD=${POSTGRES_PASSWORD} psql -U ${POSTGRES_USER} ${POSTGRES_DB} -c 'SELECT 1 FROM users LIMIT 1'"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
2021-10-20 19:57:11 +00:00
|
|
|
expose:
|
|
|
|
- "5432"
|
|
|
|
ports:
|
|
|
|
- "5431:5432"
|
|
|
|
env_file:
|
2024-03-13 14:04:09 +00:00
|
|
|
- .env.development
|
2023-06-13 01:22:10 +00:00
|
|
|
volumes:
|
2024-03-13 14:04:09 +00:00
|
|
|
- ./docker/db/seed.sql:/docker-entrypoint-initdb.d/seed.sql
|
2023-06-13 01:22:10 +00:00
|
|
|
- db:/var/lib/postgresql/data
|
2024-03-13 14:04:09 +00:00
|
|
|
labels:
|
|
|
|
CONNECT: "localhost:5431"
|
2021-10-20 19:57:11 +00:00
|
|
|
app:
|
|
|
|
container_name: app
|
2024-03-13 14:04:09 +00:00
|
|
|
build:
|
|
|
|
context: ./
|
|
|
|
args:
|
|
|
|
- UID=${CURRENT_UID}
|
|
|
|
- GID=${CURRENT_GID}
|
|
|
|
restart: unless-stopped
|
2023-04-25 21:30:28 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD", "curl", "-f", "http://localhost:3000"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
2024-03-13 14:04:09 +00:00
|
|
|
start_period: 1m
|
2021-10-20 19:57:11 +00:00
|
|
|
depends_on:
|
2024-03-13 14:04:09 +00:00
|
|
|
db:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
2021-10-20 19:57:11 +00:00
|
|
|
env_file:
|
2024-03-13 14:04:09 +00:00
|
|
|
- .env.development
|
|
|
|
expose:
|
|
|
|
- "3000"
|
2021-10-20 19:57:11 +00:00
|
|
|
ports:
|
|
|
|
- "3000:3000"
|
|
|
|
volumes:
|
|
|
|
- ./:/app
|
2024-03-13 14:04:09 +00:00
|
|
|
labels:
|
|
|
|
CONNECT: "localhost:3000"
|
2022-10-06 20:33:18 +00:00
|
|
|
worker:
|
|
|
|
container_name: worker
|
2024-03-13 14:04:09 +00:00
|
|
|
build:
|
|
|
|
context: ./worker
|
|
|
|
args:
|
|
|
|
- UID=${CURRENT_UID}
|
|
|
|
- GID=${CURRENT_GID}
|
|
|
|
restart: unless-stopped
|
2022-10-06 20:33:18 +00:00
|
|
|
depends_on:
|
2023-04-25 21:30:28 +00:00
|
|
|
db:
|
2024-03-13 14:04:09 +00:00
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
2023-04-25 21:30:28 +00:00
|
|
|
app:
|
|
|
|
condition: service_healthy
|
2024-03-13 14:04:09 +00:00
|
|
|
restart: true
|
2022-10-06 20:33:18 +00:00
|
|
|
env_file:
|
2024-03-13 14:04:09 +00:00
|
|
|
- .env.development
|
2022-10-06 20:33:18 +00:00
|
|
|
volumes:
|
|
|
|
- ./:/app
|
|
|
|
entrypoint: ["/bin/sh", "-c"]
|
2023-04-25 21:30:28 +00:00
|
|
|
command:
|
2024-03-13 14:04:09 +00:00
|
|
|
- npm run worker:dev
|
2023-07-13 00:10:01 +00:00
|
|
|
imgproxy:
|
|
|
|
container_name: imgproxy
|
2024-03-16 02:15:49 +00:00
|
|
|
image: darthsim/imgproxy:v3.23.0
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- images
|
2023-07-13 00:10:01 +00:00
|
|
|
healthcheck:
|
|
|
|
test: [ "CMD", "imgproxy", "health" ]
|
|
|
|
interval: 10s
|
2024-03-13 14:04:09 +00:00
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
|
|
|
restart: unless-stopped
|
2023-07-13 00:10:01 +00:00
|
|
|
env_file:
|
2024-03-13 14:04:09 +00:00
|
|
|
- .env.development
|
|
|
|
ports:
|
|
|
|
- "3001:8080"
|
2023-07-13 00:10:01 +00:00
|
|
|
expose:
|
|
|
|
- "8080"
|
2024-03-13 14:04:09 +00:00
|
|
|
labels:
|
|
|
|
- "CONNECT=localhost:3001"
|
|
|
|
s3:
|
|
|
|
container_name: s3
|
|
|
|
image: localstack/localstack:s3-latest
|
|
|
|
# healthcheck:
|
|
|
|
# test: ["CMD-SHELL", "awslocal", "s3", "ls", "s3://uploads"]
|
|
|
|
# interval: 10s
|
|
|
|
# timeout: 10s
|
|
|
|
# retries: 10
|
|
|
|
# start_period: 1m
|
|
|
|
restart: unless-stopped
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- images
|
2024-03-13 14:04:09 +00:00
|
|
|
env_file:
|
|
|
|
- .env.development
|
|
|
|
environment:
|
|
|
|
- DEBUG=1
|
2023-07-13 00:10:01 +00:00
|
|
|
ports:
|
2024-03-13 14:04:09 +00:00
|
|
|
- "4566:4566"
|
|
|
|
expose:
|
|
|
|
- "4566"
|
|
|
|
volumes:
|
|
|
|
- 's3:/var/lib/localstack'
|
|
|
|
- './docker/s3/init-s3.sh:/etc/localstack/init/ready.d/init-s3.sh'
|
|
|
|
- './docker/s3/cors.json:/etc/localstack/init/ready.d/cors.json'
|
|
|
|
labels:
|
|
|
|
- "CONNECT=localhost:4566"
|
2023-09-24 23:24:04 +00:00
|
|
|
opensearch:
|
2024-03-13 14:04:09 +00:00
|
|
|
image: opensearchproject/opensearch:2.12.0
|
2023-09-24 23:24:04 +00:00
|
|
|
container_name: opensearch
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- search
|
2024-03-13 14:04:09 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "curl -ku admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} --silent --fail localhost:9200/_cluster/health || exit 1"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
|
|
|
restart: unless-stopped
|
|
|
|
env_file:
|
|
|
|
- .env.development
|
2023-09-24 23:24:04 +00:00
|
|
|
environment:
|
2024-03-13 14:04:09 +00:00
|
|
|
- OPENSEARCH_INITIAL_ADMIN_PASSWORD=mVchg1T5oA9wudUh
|
2023-09-24 23:24:04 +00:00
|
|
|
ports:
|
|
|
|
- 9200:9200 # REST API
|
|
|
|
- 9600:9600 # Performance Analyzer
|
|
|
|
volumes:
|
|
|
|
- os:/usr/share/opensearch/data
|
2024-03-13 14:04:09 +00:00
|
|
|
labels:
|
|
|
|
CONNECT: "localhost:9200"
|
2023-09-24 23:24:04 +00:00
|
|
|
command: >
|
|
|
|
bash -c '
|
|
|
|
set -m
|
|
|
|
/usr/share/opensearch/opensearch-docker-entrypoint.sh &
|
2024-03-13 14:04:09 +00:00
|
|
|
until curl -sS "http://localhost:9200/_cat/health?h=status" -ku admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD} | grep -q "green\|yellow"; do
|
2023-09-24 23:24:04 +00:00
|
|
|
echo "Waiting for OpenSearch to start..."
|
|
|
|
sleep 1
|
|
|
|
done
|
|
|
|
echo "OpenSearch started."
|
2024-03-15 19:29:42 +00:00
|
|
|
curl \
|
|
|
|
-H "Content-Type: application/json" \
|
|
|
|
-X PUT \
|
|
|
|
-d '{"mappings":{"properties":{"text":{"type":"text","analyzer":"english","fields":{"keyword":{"type":"keyword","ignore_above":256}}},"title":{"type":"text","analyzer":"english","fields":{"keyword":{"type":"keyword","ignore_above":256}}}}}}' \
|
|
|
|
"http://localhost:9200/item" \
|
|
|
|
-ku admin:${OPENSEARCH_INITIAL_ADMIN_PASSWORD}
|
2023-09-24 23:24:04 +00:00
|
|
|
echo "OpenSearch index created."
|
|
|
|
fg
|
|
|
|
'
|
|
|
|
os-dashboard:
|
2024-03-13 14:04:09 +00:00
|
|
|
image: opensearchproject/opensearch-dashboards:2.12.0
|
2023-09-24 23:24:04 +00:00
|
|
|
container_name: os-dashboard
|
2024-03-13 14:04:09 +00:00
|
|
|
restart: unless-stopped
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- search
|
2024-03-13 14:04:09 +00:00
|
|
|
depends_on:
|
|
|
|
opensearch:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
env_file:
|
|
|
|
- .env.development
|
2023-09-24 23:24:04 +00:00
|
|
|
environment:
|
|
|
|
- opensearch.ssl.verificationMode=none
|
|
|
|
- OPENSEARCH_HOSTS=http://opensearch:9200
|
2024-03-13 14:04:09 +00:00
|
|
|
- server.ssl.enabled=false
|
2023-09-24 23:24:04 +00:00
|
|
|
ports:
|
|
|
|
- 5601:5601
|
|
|
|
links:
|
|
|
|
- opensearch
|
2024-03-13 14:04:09 +00:00
|
|
|
labels:
|
|
|
|
CONNECT: "localhost:5601"
|
|
|
|
bitcoin:
|
|
|
|
image: polarlightning/bitcoind:26.0
|
|
|
|
container_name: bitcoin
|
|
|
|
restart: unless-stopped
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- payments
|
2024-03-13 14:04:09 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} getblockchaininfo"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
|
|
|
command:
|
|
|
|
- 'bitcoind'
|
|
|
|
- '-server=1'
|
|
|
|
- '-regtest=1'
|
|
|
|
- '-rpcauth=${RPC_USER}:${RPC_AUTH}'
|
|
|
|
- '-debug=1'
|
|
|
|
- '-zmqpubrawblock=tcp://0.0.0.0:${ZMQ_BLOCK_PORT}'
|
|
|
|
- '-zmqpubrawtx=tcp://0.0.0.0:${ZMQ_TX_PORT}'
|
|
|
|
- '-txindex=1'
|
|
|
|
- '-dnsseed=0'
|
|
|
|
- '-upnp=0'
|
|
|
|
- '-rpcbind=0.0.0.0'
|
|
|
|
- '-rpcallowip=0.0.0.0/0'
|
|
|
|
- '-rpcport=${RPC_PORT}'
|
|
|
|
- '-rest'
|
|
|
|
- '-listen=1'
|
|
|
|
- '-listenonion=0'
|
|
|
|
- '-fallbackfee=0.0002'
|
|
|
|
- '-blockfilterindex=1'
|
|
|
|
- '-peerblockfilters=1'
|
|
|
|
expose:
|
|
|
|
- "${RPC_PORT}"
|
|
|
|
- "${P2P_PORT}"
|
|
|
|
- "${ZMQ_BLOCK_PORT}"
|
|
|
|
- "${ZMQ_TX_PORT}"
|
|
|
|
volumes:
|
|
|
|
- bitcoin:/home/bitcoin/.bitcoin
|
|
|
|
labels:
|
|
|
|
ofelia.enabled: "true"
|
|
|
|
ofelia.job-exec.minecron.schedule: "@every 1m"
|
|
|
|
ofelia.job-exec.minecron.command: >
|
|
|
|
bash -c '
|
|
|
|
blockcount=$$(bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} getblockcount 2>/dev/null)
|
|
|
|
if (( blockcount <= 0 )); then
|
|
|
|
echo "Mining 10 blocks to sn_lnd and stacker_lnd..."
|
|
|
|
bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} generatetoaddress 100 ${LND_ADDR}
|
|
|
|
bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} generatetoaddress 100 ${STACKER_LND_ADDR}
|
|
|
|
else
|
|
|
|
echo "Mining a block to sn_lnd... ${LND_ADDR}"
|
|
|
|
bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} generatetoaddress 1 ${LND_ADDR}
|
|
|
|
echo "Mining a block to stacker_lnd... ${STACKER_LND_ADDR}"
|
|
|
|
bitcoin-cli -chain=regtest -rpcport=${RPC_PORT} -rpcuser=${RPC_USER} -rpcpassword=${RPC_PASS} generatetoaddress 1 ${STACKER_LND_ADDR}
|
|
|
|
fi
|
|
|
|
'
|
|
|
|
sn_lnd:
|
|
|
|
build:
|
|
|
|
context: ./docker/lnd
|
|
|
|
args:
|
|
|
|
- LN_NODE_FOR=sn
|
|
|
|
container_name: sn_lnd
|
|
|
|
restart: unless-stopped
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- payments
|
2024-03-13 14:04:09 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "lncli", "getinfo"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
|
|
|
depends_on:
|
|
|
|
bitcoin:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
env_file:
|
|
|
|
- .env.development
|
|
|
|
command:
|
|
|
|
- 'lnd'
|
|
|
|
- '--noseedbackup'
|
|
|
|
- '--trickledelay=5000'
|
|
|
|
- '--alias=sn_lnd'
|
|
|
|
- '--externalip=sn_lnd'
|
|
|
|
- '--tlsextradomain=sn_lnd'
|
|
|
|
- '--tlsextradomain=host.docker.internal'
|
|
|
|
- '--listen=0.0.0.0:${LND_P2P_PORT}'
|
|
|
|
- '--rpclisten=0.0.0.0:${LND_GRPC_PORT}'
|
|
|
|
- '--restlisten=0.0.0.0:${LND_REST_PORT}'
|
|
|
|
- '--bitcoin.active'
|
|
|
|
- '--bitcoin.regtest'
|
|
|
|
- '--bitcoin.node=bitcoind'
|
|
|
|
- '--bitcoind.rpchost=bitcoin'
|
|
|
|
- '--bitcoind.rpcuser=${RPC_USER}'
|
|
|
|
- '--bitcoind.rpcpass=${RPC_PASS}'
|
|
|
|
- '--bitcoind.zmqpubrawblock=tcp://bitcoin:${ZMQ_BLOCK_PORT}'
|
|
|
|
- '--bitcoind.zmqpubrawtx=tcp://bitcoin:${ZMQ_TX_PORT}'
|
|
|
|
- '--protocol.wumbo-channels'
|
|
|
|
- '--maxchansize=1000000000'
|
|
|
|
- '--allow-circular-route'
|
|
|
|
- '--bitcoin.defaultchanconfs=1'
|
|
|
|
- '--maxpendingchannels=10'
|
|
|
|
expose:
|
|
|
|
- "${LND_P2P_PORT}"
|
|
|
|
ports:
|
|
|
|
- "${LND_REST_PORT}:${LND_REST_PORT}"
|
|
|
|
- "${LND_GRPC_PORT}:${LND_GRPC_PORT}"
|
|
|
|
volumes:
|
|
|
|
- sn_lnd:/home/lnd/.lnd
|
|
|
|
labels:
|
|
|
|
ofelia.enabled: "true"
|
|
|
|
ofelia.job-exec.sn_channel_cron.schedule: "@every 1m"
|
|
|
|
ofelia.job-exec.sn_channel_cron.command: >
|
|
|
|
su lnd -c bash -c "
|
|
|
|
if [ $$(lncli getinfo | jq '.num_active_channels + .num_pending_channels') -ge 3 ]; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
lncli openchannel --node_key=$STACKER_LND_PUBKEY --connect stacker_lnd:9735 --sat_per_vbyte 1 \\
|
|
|
|
--min_confs 0 --local_amt=1000000000 --push_amt=500000000
|
|
|
|
fi
|
|
|
|
"
|
|
|
|
stacker_lnd:
|
|
|
|
build:
|
|
|
|
context: ./docker/lnd
|
|
|
|
args:
|
|
|
|
- LN_NODE_FOR=stacker
|
|
|
|
container_name: stacker_lnd
|
|
|
|
restart: unless-stopped
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- payments
|
2024-03-13 14:04:09 +00:00
|
|
|
healthcheck:
|
|
|
|
test: ["CMD-SHELL", "lncli", "getinfo"]
|
|
|
|
interval: 10s
|
|
|
|
timeout: 10s
|
|
|
|
retries: 10
|
|
|
|
start_period: 1m
|
|
|
|
depends_on:
|
|
|
|
bitcoin:
|
|
|
|
condition: service_healthy
|
|
|
|
restart: true
|
|
|
|
env_file:
|
|
|
|
- .env.development
|
|
|
|
command:
|
|
|
|
- 'lnd'
|
|
|
|
- '--noseedbackup'
|
|
|
|
- '--trickledelay=5000'
|
|
|
|
- '--alias=stacker_lnd'
|
|
|
|
- '--externalip=stacker_lnd'
|
|
|
|
- '--tlsextradomain=stacker_lnd'
|
|
|
|
- '--tlsextradomain=host.docker.internal'
|
|
|
|
- '--listen=0.0.0.0:${LND_P2P_PORT}'
|
|
|
|
- '--rpclisten=0.0.0.0:${LND_GRPC_PORT}'
|
|
|
|
- '--restlisten=0.0.0.0:${LND_REST_PORT}'
|
|
|
|
- '--bitcoin.active'
|
|
|
|
- '--bitcoin.regtest'
|
|
|
|
- '--bitcoin.node=bitcoind'
|
|
|
|
- '--bitcoind.rpchost=bitcoin'
|
|
|
|
- '--bitcoind.rpcuser=${RPC_USER}'
|
|
|
|
- '--bitcoind.rpcpass=${RPC_PASS}'
|
|
|
|
- '--bitcoind.zmqpubrawblock=tcp://bitcoin:${ZMQ_BLOCK_PORT}'
|
|
|
|
- '--bitcoind.zmqpubrawtx=tcp://bitcoin:${ZMQ_TX_PORT}'
|
|
|
|
- '--protocol.wumbo-channels'
|
|
|
|
- '--maxchansize=1000000000'
|
|
|
|
- '--allow-circular-route'
|
|
|
|
- '--bitcoin.defaultchanconfs=1'
|
|
|
|
- '--maxpendingchannels=10'
|
|
|
|
expose:
|
|
|
|
- "${LND_P2P_PORT}"
|
|
|
|
ports:
|
|
|
|
- "${STACKER_LND_REST_PORT}:${LND_REST_PORT}"
|
|
|
|
- "${STACKER_LND_GRPC_PORT}:${LND_GRPC_PORT}"
|
|
|
|
volumes:
|
|
|
|
- stacker_lnd:/home/lnd/.lnd
|
|
|
|
labels:
|
|
|
|
ofelia.enabled: "true"
|
|
|
|
ofelia.job-exec.stacker_channel_cron.schedule: "@every 1m"
|
|
|
|
ofelia.job-exec.stacker_channel_cron.command: >
|
|
|
|
su lnd -c bash -c "
|
|
|
|
if [ $$(lncli getinfo | jq '.num_active_channels + .num_pending_channels') -ge 3 ]; then
|
|
|
|
exit 0
|
|
|
|
else
|
|
|
|
lncli openchannel --node_key=$LND_PUBKEY --connect sn_lnd:9735 --sat_per_vbyte 1 \\
|
|
|
|
--min_confs 0 --local_amt=1000000000 --push_amt=500000000
|
|
|
|
fi
|
|
|
|
"
|
|
|
|
channdler:
|
|
|
|
image: mcuadros/ofelia:latest
|
|
|
|
container_name: channdler
|
2024-03-18 01:43:34 +00:00
|
|
|
profiles:
|
|
|
|
- payments
|
2024-03-13 14:04:09 +00:00
|
|
|
depends_on:
|
|
|
|
- bitcoin
|
|
|
|
- sn_lnd
|
|
|
|
- stacker_lnd
|
|
|
|
restart: unless-stopped
|
|
|
|
command: daemon --docker -f label=com.docker.compose.project=${COMPOSE_PROJECT_NAME}
|
|
|
|
volumes:
|
|
|
|
- /var/run/docker.sock:/var/run/docker.sock:ro
|
2023-06-13 01:22:10 +00:00
|
|
|
volumes:
|
2023-09-24 23:24:04 +00:00
|
|
|
db:
|
|
|
|
os:
|
2024-03-13 14:04:09 +00:00
|
|
|
bitcoin:
|
|
|
|
sn_lnd:
|
|
|
|
stacker_lnd:
|
|
|
|
s3:
|