Skip to content

Commit a4569ab

Browse files
committed
enh: add startup script cmds and updated compose file
1 parent ce81f1a commit a4569ab

File tree

2 files changed

+60
-0
lines changed

2 files changed

+60
-0
lines changed

docker-compose.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,26 @@ services:
1414
extra_hosts:
1515
- "host.docker.internal:host-gateway"
1616

17+
ethereum:
18+
image: ethereum/client-go:stable
19+
ports:
20+
- "8545:8545"
21+
- "30303:30303"
22+
command: --http --http.addr 0.0.0.0 --http.port 8545 --http.api eth,net,web3 --syncmode snap
23+
24+
dd_rpc:
25+
image: ghcr.io/developer-dao/rpc:latest
26+
ports:
27+
- "8080:80"
28+
environment:
29+
- DATABASE_URL=postgresql://ddrpcdev:ddrpc123@postgres:5432/ddrpc
30+
- ETHEREUM_ENDPOINT=http://ethereum:8545
31+
32+
- SMTP_PASSWORD=TEST
33+
- JWT_KEY=0cd8a9ca80c521ce59f4663bfc5379b7a4acc11c34d8852dfc9a71b6dba00985
34+
depends_on:
35+
- postgres
36+
- ethereum
37+
1738
volumes:
1839
postgres_data:

infra/bootstrap/userdata.sh

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Runs on an Ubuntu 24.04 instance
2+
3+
# Add Docker's official GPG key:
4+
sudo apt-get update
5+
sudo apt-get install ca-certificates curl build-essential -y
6+
sudo install -m 0755 -d /etc/apt/keyrings
7+
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
8+
sudo chmod a+r /etc/apt/keyrings/docker.asc
9+
10+
# Add the repository to Apt sources:
11+
echo \
12+
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
13+
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
14+
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
15+
sudo apt-get update
16+
17+
# Install Docker components
18+
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
19+
20+
# Install Rust - this approach is interactive and will lock user data
21+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
22+
source $HOME/.cargo/env
23+
24+
# Get Github PAT to download image from private repo
25+
export CR_PAT=""
26+
echo $CR_PAT | docker login ghcr.io -u USERNAME --password-stdin
27+
28+
# Pull RPC image
29+
docker pull ghcr.io/developer-dao/rpc:latest
30+
31+
# Clone repo
32+
git clone [email protected]:Developer-DAO/rpc.git /opt/rpc
33+
cd /opt/rpc
34+
35+
# Set up project
36+
#cargo build
37+
#cargo install openssl sqlx-cli
38+
39+
docker compose up -d

0 commit comments

Comments
 (0)