Skip to content

Commit

Permalink
Merge pull request #2 from smartmeio/rearrangement
Browse files Browse the repository at this point in the history
Rearrangement
  • Loading branch information
fabio14 authored May 17, 2023
2 parents 76300da + 2b02eac commit 551353b
Show file tree
Hide file tree
Showing 25 changed files with 660 additions and 683 deletions.
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
LRPORT=1474
ARPORT=1475
MPORT=1883
MSPORT=8883
MWSPORT=9001
REDPORT=1880
69 changes: 52 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,34 @@ docker-compose : https://docs.docker.com/compose/

## How to run

* Install docker on your system as described [here](https://docs.docker.com/get-docker/)
* Install docker-compose on your system as described [here](https://docs.docker.com/compose/install/)
* Install docker on your system as described (min 20.10.x) [here](https://docs.docker.com/get-docker/)
* Install docker-compose on your system as described (min 2.5.x) [here](https://github.com/docker/compose/releases/tag/v2.5.0)
* `cd` into the root folder of this project
* create a .env file
```bash
cp env_template .env
```
* and then run:
```bash
docker-compose up -d
```
to build-up the container stack based on Debian Buster.
to build-up the container stack based on Alpine Linux.

* instead run:
```bash
docker-compose -f docker-compose-alpine.yml up -d
docker-compose -f docker-compose-debian.yml up -d
```

to build-up the container stack based on Alpine Linux.
to build-up the container stack based on Debian Buster.

Once the command has been fired-up, docker-compose itself will take care of building the layer images and running a set of isolated containers in a standard docker network. In the very specific, the running containers will be:

* **redis-volatile** (volatile instance of Redis running on port 6379)
* **redis-persistent** (persistent instance of Redis running on port 6380)
* **rediseen-volatile** (REST-like API service for Redis volatile database running on port 8000)
* **rediseen-persistent** (REST-like API service for Redis persistent database running on port 8001)
* **lrod** (instance of Lightning-rod python module running on port 1474)
* **arancino** (instance of arancino python module running on port 1475)
* **redis-volatile** (volatile instance of Redis)
* **redis-persistent** (persistent instance of Redis)
* **lrod** (instance of Lightning-rod python module)
* **arancino** (instance of arancino python module)
* **mosquitto** (instance of mosquitto)
* **nodered** (instance of nodered)

to be sure that the containers are properly up and running, execute from bash:

Expand Down Expand Up @@ -59,24 +63,55 @@ tail -f /var/log/arancino/arancino.log

what we expect, of course, is to get the MCU firmware interacting with the python module as it should on a physical Arancino main board.

## How to run without building the docker layer images
## Change the default ports
These are the default values:

|Service| Variable | Port |
|-------|-------|---|
|lrod|LRPORT|1474|
|arancino api|ARPORT|1475|
|mosquitto default|MPORT|1883|
|secure mosquitto |MSPORT|8883|
|websocket mosquitto |MWSPORT|9001|
|nodered |REDPORT|1880|

* Install docker on your system as described [here](https://docs.docker.com/get-docker/)
* Install docker-compose on your system as described [here](https://docs.docker.com/compose/install/)
edit the .env file if you need to change them.

## How to launch the stack

* Install docker on your system as described (min 20.10.x) [here](https://docs.docker.com/get-docker/)
* Install docker-compose on your system as described (min 2.5.x) [here](https://github.com/docker/compose/releases/tag/v2.5.0)
* `cd` into the root folder of this project
* and then run:
```bash
docker-compose -f docker-compose-no-build.yml up -d
docker-compose up -d
```
to build-up the container stack based on Debian Buster.
to build-up the container stack based on Alpine Linux.

* instead run:
```bash
docker-compose -f docker-compose-alpine-no-build.yml up -d
docker-compose -f docker-compose-debian.yml up -d
```
to build-up the container stack based on Debian Buster.

## How to launch the stack with building the docker layer images

* Install docker on your system as described (min 20.10.x) [here](https://docs.docker.com/get-docker/)
* Install docker-compose on your system as described (min 2.5.x) [here](https://github.com/docker/compose/releases/tag/v2.5.0)
* `cd` into the root folder of this project
* and then run:
```bash
docker-compose -f docker-compose-build.yml up -d
```
to build-up the container stack based on Alpine Linux.

* instead run:
```bash
docker-compose -f docker-compose-build-debian.yml up -d
```
to build-up the container stack based on Debian Buster.


## Final notes for Mac OSX

Please note that under OSX, due to the specific system design, all volumes starting with the prefix:
Expand Down
33 changes: 1 addition & 32 deletions araX/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,36 +43,6 @@ services:
networks:
- "arancino_net"

rediseen-volatile:
restart: always
privileged: true
image: smartmeio/rediseen:2.4.0
environment:
- REDISEEN_REDIS_URI=redis://:@redis-volatile-arancino:6379
- REDISEEN_DB_EXPOSED=0-5
- REDISEEN_KEY_PATTERN_EXPOSE_ALL=true
- REDISEEN_HOST=0.0.0.0
- REDISEEN_PORT=8001
depends_on:
- redis-volatile-arancino
networks:
- "arancino_net"

rediseen-persistent:
restart: always
privileged: true
image: smartmeio/rediseen:2.4.0
environment:
- REDISEEN_REDIS_URI=redis://:@redis-persistent-arancino:6380
- REDISEEN_DB_EXPOSED=0-5
- REDISEEN_KEY_PATTERN_EXPOSE_ALL=true
- REDISEEN_HOST=0.0.0.0
- REDISEEN_PORT=8002
depends_on:
- redis-persistent-arancino
networks:
- "arancino_net"

arancino:
restart: always
privileged: true
Expand All @@ -91,8 +61,7 @@ services:
depends_on:
- redis-volatile-arancino
- redis-persistent-arancino
- rediseen-volatile
- rediseen-persistent

ports:
- "127.0.0.1:${ARPORT}:1475"
networks:
Expand Down
152 changes: 0 additions & 152 deletions docker-compose-alpine-no-build.yml

This file was deleted.

Loading

0 comments on commit 551353b

Please sign in to comment.