mirror of
https://github.com/recrof/map.meshcore.dev-uploader.git
synced 2026-03-28 17:42:45 +01:00
Dockerize the application
This commit is contained in:
11
Dockerfile
Normal file
11
Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
FROM node:22-alpine
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY package*.json ./
|
||||||
|
|
||||||
|
RUN npm install
|
||||||
|
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
CMD ["sh", "-c", "node index.mjs ${DEVICE:-/dev/ttyACM0}"]
|
||||||
11
README.md
11
README.md
@@ -14,7 +14,14 @@ git clone https://github.com/recrof/map.meshcore.dev-uploader
|
|||||||
cd map.meshcore.dev-uploader
|
cd map.meshcore.dev-uploader
|
||||||
npm install .
|
npm install .
|
||||||
```
|
```
|
||||||
|
### Usage
|
||||||
## Usage
|
|
||||||
1. Connect working MeshCore companion usb into the computer
|
1. Connect working MeshCore companion usb into the computer
|
||||||
2. run `node index.mjs [usb_port]`
|
2. run `node index.mjs [usb_port]`
|
||||||
|
|
||||||
|
## Running with Docker
|
||||||
|
After cloning the repo, build and run the docker image with
|
||||||
|
```sh
|
||||||
|
docker-compose build
|
||||||
|
docker-compose up
|
||||||
|
```
|
||||||
|
You will be able to inspect the logs. Once everything is working correctly, run the container with ``docker-compose up -d`` to run it in the background.
|
||||||
12
docker-compose.yml
Normal file
12
docker-compose.yml
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
services:
|
||||||
|
map-uploader:
|
||||||
|
build: .
|
||||||
|
environment:
|
||||||
|
# Set to the appropriate device for your setup, either /dev/ttyACM0 if connected by USB to a USB companion or IP:port if connected over network to a wifi companion
|
||||||
|
- DEVICE=/dev/ttyACM0
|
||||||
|
restart: unless-stopped
|
||||||
|
# Only necessary for accessing USB devices, such as a USB companion
|
||||||
|
privileged: true
|
||||||
|
# Adjust according to your setup, but this is the default
|
||||||
|
devices:
|
||||||
|
- /dev/ttyACM0:/dev/ttyACM0
|
||||||
Reference in New Issue
Block a user