Merge branch 'feature/nginx-fixes' into develop
This commit is contained in:
commit
1a75356fca
|
@ -1,4 +1,5 @@
|
||||||
FROM node:12.22.3-alpine AS builder
|
FROM node:12.22.3-alpine AS builder
|
||||||
|
RUN npm i -g npm@7.19.1
|
||||||
WORKDIR /otterscan-build
|
WORKDIR /otterscan-build
|
||||||
COPY ["package.json", "package-lock.json", "/otterscan-build/"]
|
COPY ["package.json", "package-lock.json", "/otterscan-build/"]
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
|
@ -16,7 +16,7 @@ Clone Otterscan repo and its submodules. Checkout the tag corresponding to your
|
||||||
git clone --recurse-submodules git@github.com:wmitsuda/otterscan.git
|
git clone --recurse-submodules git@github.com:wmitsuda/otterscan.git
|
||||||
cd otterscan
|
cd otterscan
|
||||||
git checkout <version-tag-otterscan>
|
git checkout <version-tag-otterscan>
|
||||||
docker build -t otterscan -f Dockerfile .
|
DOCKER_BUILDKIT=1 docker build -t otterscan -f Dockerfile .
|
||||||
```
|
```
|
||||||
|
|
||||||
This will run the entire build process inside a build container, merge the production build of the React app with the 4bytes and trustwallet assets into the same image format it is published in Docker Hub, but locally under the name `otterscan`.
|
This will run the entire build process inside a build container, merge the production build of the React app with the 4bytes and trustwallet assets into the same image format it is published in Docker Hub, but locally under the name `otterscan`.
|
||||||
|
@ -47,13 +47,13 @@ By default, it assumes your Erigon `rpcdaemon` processs is serving requests at `
|
||||||
Start serving 4bytes and trustwallet assets at `localhost:3001` using a dockerized nginx:
|
Start serving 4bytes and trustwallet assets at `localhost:3001` using a dockerized nginx:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run start-assets
|
npm run assets-start
|
||||||
```
|
```
|
||||||
|
|
||||||
To stop it, run:
|
To stop it, run:
|
||||||
|
|
||||||
```
|
```
|
||||||
npm run stop-assets
|
npm run assets-stop
|
||||||
```
|
```
|
||||||
|
|
||||||
To run Otterscan development build:
|
To run Otterscan development build:
|
||||||
|
|
|
@ -4,6 +4,11 @@ server {
|
||||||
|
|
||||||
#access_log /var/log/nginx/host.access.log main;
|
#access_log /var/log/nginx/host.access.log main;
|
||||||
|
|
||||||
|
location /static {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
expires max;
|
||||||
|
}
|
||||||
|
|
||||||
location /signatures {
|
location /signatures {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
expires 30d;
|
expires 30d;
|
||||||
|
|
10
package.json
10
package.json
|
@ -43,11 +43,11 @@
|
||||||
"build": "craco build",
|
"build": "craco build",
|
||||||
"test": "craco test",
|
"test": "craco test",
|
||||||
"eject": "react-scripts eject",
|
"eject": "react-scripts eject",
|
||||||
"start-assets": "docker run --rm -p 3001:80 --name otterscan-assets -d -v$(pwd)/4bytes/signatures:/usr/share/nginx/html/signatures/ -v$(pwd)/trustwallet/blockchains/ethereum/assets:/usr/share/nginx/html/assets -v$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf nginx:1.21.1-alpine",
|
"assets-start": "docker run --rm -p 3001:80 --name otterscan-assets -d -v$(pwd)/4bytes/signatures:/usr/share/nginx/html/signatures/ -v$(pwd)/trustwallet/blockchains/ethereum/assets:/usr/share/nginx/html/assets -v$(pwd)/nginx.conf:/etc/nginx/conf.d/default.conf nginx:1.21.1-alpine",
|
||||||
"stop-assets": "docker stop otterscan-assets",
|
"assets-stop": "docker stop otterscan-assets",
|
||||||
"build-docker": "DOCKER_BUILDKIT=1 docker build -t otterscan -f Dockerfile .",
|
"docker-build": "DOCKER_BUILDKIT=1 docker build -t otterscan -f Dockerfile .",
|
||||||
"start-docker": "docker run --rm -p 5000:80 --name otterscan -d otterscan",
|
"docker-start": "docker run --rm -p 5000:80 --name otterscan -d otterscan",
|
||||||
"stop-docker": "docker stop otterscan"
|
"docker-stop": "docker stop otterscan"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
"extends": [
|
"extends": [
|
||||||
|
|
Loading…
Reference in New Issue