Skip to content
Merged
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
22 changes: 17 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,23 @@
FROM node:20-alpine

# Create working directory
RUN mkdir -p /opt/app
RUN mkdir -p /opt/app/src
WORKDIR /opt/app
COPY tsconfig.json ./
COPY .env ./
WORKDIR /opt/app.

# Copy and install dependencies
COPY package.json package-lock.json ./
RUN npm install

# Copy source and config files
COPY tsconfig.json ./
COPY .env ./
COPY src/ ./src/

# Build project
RUN npm run build

# Expose application port
EXPOSE 3000
CMD [ "npm", "start"]

# Start app
CMD [ "npm", "start"]
59 changes: 53 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,54 @@
# M3tering Console
# M3tering Console Setup

## Installation
- `git clone https://github.com/M3tering/Console.git`
- `cd Console/`
- `npm install`
- `npm run start`
## Quick Setup

1. **Clone/Update**

```bash
git clone https://github.com/M3tering/Console.git
# or
cd Console/ && git pull
```

2. **Environment Variables**
Create `.env` file:

```
PORT=3000
API_TOKEN=...
APPLICATION_ID=...
CONTRACT_LABEL=M3ters
CHIRPSTACK_HOST=host.docker.internal
MAINNET_RPC=https://sepolia.drpc.org
PREFERRED_PROVER_NODE=http://34.244.149.153
```

3. **Docker Build**

```bash
sudo docker build -t console .
# If error: sudo systemctl restart docker
```

4. **Docker Run**
```bash
sudo docker run -detach --restart unless-stopped --add-host=host.docker.internal:host-gateway console
```

## Docker Commands

- `sudo docker ps` - list running containers
- `sudo docker ps -a` - list all containers
- `sudo docker stop <container_id>` - stop container
- `sudo docker rm <container_id>` - remove container
- `sudo docker logs <container_id>` - view logs
- `sudo docker logs -f -t <container_id>` - follow logs with timestamps
- `sudo docker system prune` - cleanup unused containers/images
- `sudo docker system prune -a` - cleanup everything unused

## Development

```bash
npm install
npm run dev
```
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
"description": "Service console for providers on the m3tering protocol",
"main": "src/index.ts",
"scripts": {
"start": "ts-node src/index.ts",
"start": "node dist/src/index.js",
"build": "tsc -p tsconfig.json",
"dev": "nodemon --exec ts-node src/index.ts",
"interact": "ts-node src/logic/mqtt.ts",
"watch": "nodemon --watch 'src/**'",
Expand Down