Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerize the development environment #576

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
FROM node:14-buster-slim

WORKDIR /app

RUN apt-get update && apt-get install -y python3 make g++ git openssh-client ca-certificates && \
git config --global url."https://".insteadOf git:// && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean

ENV PYTHON /usr/bin/python3

COPY package*.json yarn.lock ./

RUN yarn cache clean && yarn install

COPY . .

ENV NODE_OPTIONS=--max_old_space_size=3072
RUN yarn build

EXPOSE 3000

CMD ["yarn", "start"]
50 changes: 50 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,53 @@ The following procedure allows to deploy T token dashboard to production:
approval of someone else from the development team.
5. Once the release action is approved, the new version is automatically
deployed to `dashboard.threshold.network`.


## Local Development

Update `package.json` to contain:

```json
"@keep-network/coverage-pools": "goerli",
"@keep-network/ecdsa": "goerli",
"@keep-network/keep-core": "1.8.1-goerli.0",
"@keep-network/keep-ecdsa": "goerli",
"@keep-network/random-beacon": "goerli",
"@keep-network/tbtc": "goerli",
"@keep-network/tbtc-v2": "goerli",
"@keep-network/tbtc-v2.ts": "development",
"@threshold-network/components": "development",
"@threshold-network/solidity-contracts": "goerli",
```

Update `.env` to contain:

```
REACT_APP_SUPPORTED_CHAIN_ID=5
REACT_APP_ETH_HOSTNAME_HTTP=https://goerli.infura.io/v3/<your API key here>
REACT_APP_ETH_HOSTNAME_WS=wss://goerli.infura.io/v3/<your API key here>
REACT_APP_MULTICALL_ADDRESS=$MULTICALL_ADDRESS

REACT_APP_FEATURE_FLAG_TBTC_V2=true
REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true
REACT_APP_FEATURE_FLAG_MULTI_APP_STAKING=true
REACT_APP_FEATURE_FLAG_FEEDBACK_MODULE=false
REACT_APP_FEATURE_FLAG_POSTHOG=false
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
REACT_APP_SENTRY_DSN=$SENTRY_DSN

REACT_APP_ELECTRUM_PROTOCOL=wss
REACT_APP_ELECTRUM_HOST=electrumx-server.test.tbtc.network
REACT_APP_ELECTRUM_PORT=8443
REACT_APP_MOCK_BITCOIN_CLIENT=false

REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID
```

Then build the docker container and run the dashboard:

```bash
docker build -t dashboard:latest .
docker run -p 3000:3000 -d dashboard
```

Loading