mirror of
https://github.com/pezkuwichain/pezkuwi-telemetry.git
synced 2026-06-24 04:11:06 +00:00
Created a Dockerfile & docker-compose so theres no need to run in separate terminals (#111)
* docker file & docker-compose * Readme & spelling corretions * undoing formatOnSave changes * more changes to readme
This commit is contained in:
+16
@@ -0,0 +1,16 @@
|
|||||||
|
FROM node:alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN apk update && apk add python g++ make openssh git bash pdftk
|
||||||
|
RUN export PYTHONPATH=${PYTHONPATH}:/usr/lib/python2.7
|
||||||
|
|
||||||
|
COPY ./package.json yarn.lock ./
|
||||||
|
|
||||||
|
RUN yarn
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
# Frontend is exposing 3000
|
||||||
|
# Backend is exposing 8080
|
||||||
|
# No need for expose, if using docker-compose & docker run -p 3000:3000
|
||||||
@@ -22,4 +22,14 @@ yarn start:frontend
|
|||||||
./target/debug/polkadot --dev --telemetry-url ws://localhost:1024
|
./target/debug/polkadot --dev --telemetry-url ws://localhost:1024
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Run via Docker
|
||||||
|
To run via docker make sure that you have Docker Desktop
|
||||||
|
- If you dont you can download for you OS here [Docker Desktop](https://www.docker.com/products/docker-desktop)
|
||||||
|
```
|
||||||
|
docker-compose up --build -d
|
||||||
|
```
|
||||||
|
- -d stands for detach, if you would like to see logs i recommend using [Kitmatic](https://kitematic.com/) or dont use the -d
|
||||||
|
- --build will build the images and rebuild, but this is not required everytime
|
||||||
|
- If you want to makes UI changes, there is no need to rebuild the image as the files are being copied in via volumes.
|
||||||
|
|
||||||
Now navigate to localhost:3000 in your browser to view the app.
|
Now navigate to localhost:3000 in your browser to view the app.
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
version: "3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
telemetry-frontend:
|
||||||
|
build:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
context: ./
|
||||||
|
# Copy in changes to the ui, so no need to rebulld the images.
|
||||||
|
volumes:
|
||||||
|
- /app/node_modules
|
||||||
|
- ./packages:/app/packages
|
||||||
|
command: yarn start:frontend
|
||||||
|
ports:
|
||||||
|
- 3000:3000
|
||||||
|
telemetry-backend:
|
||||||
|
build:
|
||||||
|
dockerfile: Dockerfile
|
||||||
|
context: ./
|
||||||
|
command: yarn start:backend
|
||||||
|
environment:
|
||||||
|
- TELEMETRY_SERVER=1024
|
||||||
|
- FEED_SERVER=8080
|
||||||
|
ports:
|
||||||
|
- 8080:8080
|
||||||
|
- 1024:1024
|
||||||
@@ -3,8 +3,8 @@ import Node from './Node';
|
|||||||
import Feed from './Feed';
|
import Feed from './Feed';
|
||||||
import Aggregator from './Aggregator';
|
import Aggregator from './Aggregator';
|
||||||
|
|
||||||
const WS_PORT_TELEMETRY_SERVER = 1024;
|
const WS_PORT_TELEMETRY_SERVER = process.env.TELEMETRY_SERVER || 1024;
|
||||||
const WS_PORT_FEED_SERVER = 8080;
|
const WS_PORT_FEED_SERVER = process.env.FEED_SERVER || 8080;
|
||||||
|
|
||||||
const aggregator = new Aggregator();
|
const aggregator = new Aggregator();
|
||||||
|
|
||||||
@@ -47,4 +47,3 @@ logClients();
|
|||||||
telemetryFeed.on('connection', (socket: WebSocket) => {
|
telemetryFeed.on('connection', (socket: WebSocket) => {
|
||||||
aggregator.addFeed(new Feed(socket));
|
aggregator.addFeed(new Feed(socket));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user