Skip to content

Latest commit

 

History

History
 
 

ui

Sourcify UI

Bootstrapped with Create React App.

Running

Environment variables

Set the environment variables in .env.development depending on your settings.

The variables REACT_APP... will get injected into the build and are available at runtime.

Run

Install with npm install and run the development server with npm start.

Build

Before build you need to provide the environment variables in .env.production or .env. Check out CRA docs on env vars.

Build with

npm run build

Resulting static assets will be stored at build/ and ready to be served.

Building with Docker

The Dockerfile installs, builds and serves the project on a minimal nginx container.

Again, don't forget to provide the environment variables in .env.production or .env (CRA docs on env vars).

Build with

docker build -t sourcify-ui .

Run with

docker run -p 80:80 sourcify-ui

Running with the published Docker image

The Docker image is published on Github Container Registry. You can run it with

docker run -p 80:80 ghcr.io/ethereum/sourcify/ui:latest

However pleases note that the values in the .env files are injected on the build time so you won't be able to provide custom values for the environment variables:

REACT_APP_SERVER_URL=https://sourcify.dev/server
REACT_APP_REPOSITORY_SERVER_URL=https://repo.sourcify.dev
# Use DNSLink for IPNS
REACT_APP_IPNS=repo.sourcify.dev
REACT_APP_TAG=master

If you want to provide custom values for the environment variables you need to build the image yourself.

A workaround could be running a custom find and replace on the files before running the image:

find /usr/share/nginx/html/ -type f -exec sed -i 's#docs.sourcify.dev#yourcustomlink.com#g' {} \;;