Skip to content

Commit

Permalink
add polkadot-cloud docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Jan 3, 2024
1 parent af083fc commit a1dc50e
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 5 deletions.
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,17 @@ yarn test

## Docker

To build and run a docker container:
To build and run docker container(s):

```
yarn docker
yarn compose
```
Afterward, you can access various user interfaces as follows:

- http://localhost:8000: This displays a simple decentralized application (dapp) designed for testing the Polkamask snap.

- http://localhost:80: This presents a modified version of the Polkadot Cloud in the staking dashboard.

When using the Docker command, you can access the UI via http://localhost:8000.


<p align="center">
Expand Down
24 changes: 24 additions & 0 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
services:
polkamask:
build:
context: ./docker
environment:
NODE_ENV: production
ports:
- 8000:8000
- 8080:8080
develop:
watch:
- path: ./package.json
action: rebuild
- path: ./
target: /usr/src/app
action: sync

dashboard:
build:
context: ./dashboard-docker
environment:
NODE_ENV: production
ports:
- 80:80
15 changes: 15 additions & 0 deletions dashboard-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:buster as BUILDER

WORKDIR /app

RUN git clone https://github.com/Nick-1979/staking-dashboard.git .

RUN apt update && apt install -y git
RUN yarn install && yarn build

# --------------------------------------------------
FROM nginx

COPY --from=BUILDER /app/build /usr/share/nginx/html

EXPOSE 80
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@
"start": "yarn workspaces foreach --parallel --interlaced --verbose run start",
"test": "cd packages/snap && jest test",
"docker:build": "docker build -t polkagate/dapp -f docker/Dockerfile .",
"docker:run": "docker run --rm -it --name polkamask-ui -p 8000:8000 -p 8080:8080 polkagate/dapp:latest",
"docker": "yarn docker:build && yarn docker:run"
"docker:run": "docker run --rm -it --name polkamask-ui -p 80:80 -p 8000:8000 -p 8080:8080 polkagate/dapp:latest",
"docker": "yarn docker:build && yarn docker:run",
"compose": "docker compose up -d"
},
"devDependencies": {
"@metamask/eslint-config": "^10.0.0",
Expand Down

0 comments on commit a1dc50e

Please sign in to comment.