-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathcompose.yaml
33 lines (33 loc) · 1.32 KB
/
compose.yaml
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
services:
sapphire:
image: ubuntu:24.04
container_name: sapphire-ctn
restart: always
ports:
- "__PORT_MAINNET__:__PORT_MAINNET__" # TCP mainnet port
- "__RPCPORT_MAINNET__:__RPCPORT_MAINNET__" # RPC mainnet port
volumes:
- ${HOME}/.sapphire:/root/.sapphire:shared
command:
- bash
- -c
- |
if [ ! -f /usr/local/bin/sapphired ]; then
echo "Sapphire binary not found, setting up environment..."
apt-get update && \
apt-get install -y wget curl unzip && \
rm -rf /var/lib/apt/lists/* && \
echo $(curl -s https://api.github.com/repos/decenomy/SAPP/releases/latest | grep "browser_download_url" | grep -E "Linux(-x64)?\.zip" | cut -d '"' -f 4) > latest_release_url && \
echo "Latest release URL: $(cat latest_release_url)" && \
echo $(basename "$(cat latest_release_url)") > latest_filename && \
echo "Latest filename: $(cat latest_filename)" && \
wget "$(cat latest_release_url)" && \
unzip -q "$(cat latest_filename)" && \
rm "$(cat latest_filename)" && \
rm latest_filename && \
rm latest_release_url && \
mv sapphire* /usr/local/bin;
else
echo "Sapphire binary already installed, skipping setup."
fi
sapphired