-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
910a977
commit 5d58fa6
Showing
7 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
version: "3.5" | ||
services: | ||
beacon-validator: | ||
build: | ||
args: | ||
NETWORK: gnosis | ||
|
||
beacon-chain: | ||
build: | ||
args: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
version: "3.5" | ||
services: | ||
beacon-validator: | ||
build: | ||
args: | ||
NETWORK: holesky | ||
|
||
beacon-chain: | ||
build: | ||
args: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,10 @@ | ||
version: "3.5" | ||
services: | ||
beacon-validator: | ||
build: | ||
args: | ||
NETWORK: mainnet | ||
|
||
beacon-chain: | ||
build: | ||
args: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM nginx:1.27.0-alpine | ||
|
||
ARG NETWORK | ||
|
||
ENV NETWORK=${NETWORK} | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf.template | ||
|
||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh | ||
|
||
RUN chmod +x /usr/local/bin/entrypoint.sh | ||
|
||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"] | ||
|
||
CMD ["nginx", "-g", "daemon off;"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
if [ -z "${NETWORK}" ]; then | ||
echo "NETWORK is not defined. Exiting." | ||
exit 1 | ||
fi | ||
|
||
if [ "${NETWORK}" = "mainnet" ]; then | ||
BEACON_CHAIN_URL="http://beacon-chain.nimbus.dappnode:3500" | ||
VALIDATOR_URL="http://validator.nimbus.dappnode:3500" | ||
else | ||
BEACON_CHAIN_URL="http://beacon-chain.nimbus-${NETWORK}.dappnode:3500" | ||
VALIDATOR_URL="http://validator.nimbus-${NETWORK}.dappnode:3500" | ||
fi | ||
|
||
# Replace variables in nginx.conf | ||
sed -e "s|\${VALIDATOR_URL}|${VALIDATOR_URL}|g" -e "s|\${BEACON_CHAIN_URL}|${BEACON_CHAIN_URL}|g" /etc/nginx/nginx.conf.template >/etc/nginx/nginx.conf | ||
|
||
# Start nginx | ||
exec "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
events {} | ||
|
||
http { | ||
server { | ||
listen 3500; | ||
|
||
location / { | ||
proxy_pass ${VALIDATOR_URL}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
|
||
server { | ||
listen 4500; | ||
|
||
location / { | ||
proxy_pass ${BEACON_CHAIN_URL}; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
} | ||
} | ||
} |