Block explorer nginx (#61)

* add nginx service for block explorer

* return environment variables for web service

* remove exposed port from web service and change nginx port to 3000
This commit is contained in:
Tanya S 2024-06-07 16:53:01 +02:00 committed by GitHub
parent cc9c7d2dad
commit 580a74e7cc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 126 additions and 3 deletions

91
5xx.html Normal file
View File

@ -0,0 +1,91 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Chainlens | Blockchain Explorer</title>
<meta name="description" content="Blockchain Explorer" />
<meta http-equiv="refresh" content="10" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5.0" />
<link rel="stylesheet" href="https://use.typekit.net/odh5jwh.css" />
<style>
html,
body {
margin: 0;
padding: 0;
font-family: 'Usual', 'Arial', sans-serif;
font-weight: 400;
width: 100%;
height: 100%;
overflow-x: hidden;
}
div.creating-environment {
display: flex;
align-items: center;
justify-content: center;
flex-direction: row;
width: 100%;
height: 100%;
}
div.icon-left {
margin-right: 140px;
}
div.cog {
animation-name: rotation;
animation-duration: 11s;
animation-timing-function: ease;
animation-iteration-count: infinite;
transform-origin: 50% 50%;
}
@keyframes rotation {
0% { transform: rotate(0deg);}
12.5% {transform: rotate(45deg);}
25% {transform: rotate(90deg);}
37.5% {transform: rotate(135deg);}
50% {transform: rotate(180deg);}
62.5% {transform: rotate(225deg);}
75% {transform: rotate(270deg);}
87.5% {transform: rotate(315deg);}
100% {transform: rotate(360deg);}
}
div.text-right {
}
h2 {
font-size: 36px;
line-height: 44px;
font-weight: 600;
}
p {
font-size: 20px;
line-height: 24px;
margin: 12px 0 26px;
color: #9999AA;
}
a.link {
font-size: 12px;
line-height: 16px;
color: #786DFD;
}
</style>
</head>
<body>
<div class="creating-environment">
<div class="icon-left">
<div class="cog">
<svg width="150" height="150" viewBox="0 0 150 150" fill="none" xmlns="http://www.w3.org/2000/svg">
<path
d="M121.5 80.6875L121.437 80.8125C121.687 78.75 121.937 76.625 121.937 74.5C121.937 72.375 121.75 70.375 121.5 68.3125L121.562 68.4375L136.812 56.4375L121.625 30.0625L103.687 37.3125L103.75 37.375C100.5 34.875 96.9375 32.75 93.0625 31.125H93.125L90.25 12H59.8125L57.0625 31.1875H57.125C53.25 32.8125 49.6875 34.9375 46.4375 37.4375L46.5 37.375L28.5 30.0625L13.25 56.4375L28.5 68.4375L28.5625 68.3125C28.3125 70.375 28.125 72.375 28.125 74.5C28.125 76.625 28.3125 78.75 28.625 80.8125L28.5625 80.6875L15.4375 91L13.375 92.625L28.5625 118.875L46.5625 111.688L46.4375 111.438C49.75 114 53.3125 116.125 57.25 117.75H57.0625L59.875 137H90.1875C90.1875 137 90.375 135.875 90.5625 134.375L92.9375 117.812H92.875C96.75 116.188 100.375 114.062 103.687 111.5L103.562 111.75L121.562 118.938L136.75 92.6875C136.75 92.6875 135.875 91.9375 134.687 91.0625L121.5 80.6875ZM75 96.375C62.9375 96.375 53.125 86.5625 53.125 74.5C53.125 62.4375 62.9375 52.625 75 52.625C87.0625 52.625 96.875 62.4375 96.875 74.5C96.875 86.5625 87.0625 96.375 75 96.375Z"
fill="#483AFC"
></path>
</svg>
</div>
</div>
<div class="text-right">
<h2>Your environment is being created</h2>
<p>Give us a few minutes</p>
<a class="link" href="https://chainlens.com/" target="_blank">
Chainlens — web3labs.com
</a>
</div>
</div>
</body>
</html>

View File

@ -199,10 +199,8 @@ services:
web:
image: web3labs/epirus-free-web:latest
ports:
- 0.0.0.0:3000:3000
environment:
- API_URL=${EPIRUS_WEB_API_URL:-http://localhost:8090}
- API_URL=${EPIRUS_WEB_API_URL:-/api}
- WS_API_URL=${EPIRUS_WEB_WS_API_URL:-ws://localhost:8090}
- DISPLAY_NETWORK_TAB=disabled
depends_on:
@ -224,5 +222,18 @@ services:
networks:
- simulation
nginx:
image: nginx:latest
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./5xx.html:/www/error_pages/5xx.html
ports:
- 0.0.0.0:3000:80
depends_on:
- api
- web
networks:
- simulation
volumes:
privatekeys-volume:

21
nginx.conf Normal file
View File

@ -0,0 +1,21 @@
events { }
http {
server {
listen 80;
charset utf-8;
location /api/ {
proxy_pass http://api:8090/;
}
location / {
proxy_pass http://web:3000/;
}
error_page 500 502 503 504 /5xx.html;
location /5xx.html {
root /www/error_pages/;
}
}
}