Hello,
if you didint want to install python and all dependencies to use mappDatabase script. I created conterized version. So if you have docker or podman, you can deploy it with i few commands. Tested on Debian 12 and Suse 12.
Available container tags :6_0
, :5_12
, :latest
1. Podman/Docker
One of these platform must be installed on you system.
podman install guide
docker install guide
After instalation make sure you allow forwarding betwwen LAN and podman/docker network
Debian 12:
sudo ufw default allow FORWARD
Make sure docker/podman is running. If not you need to start it.
systemctl enable docker
systemctl start docker
2 Pull image
Docker hub page: dokcer hub
- As root run
docker pull th0masis/mappdatabase:tag
3. Run only mappConnector
mappDatabase port must be expose, becouse we want to cominicate with plc.
If database is on same machine as docker container, you dont need to expose mysql port (3306)
podman run --restar=always --name mappdatabase-01 -d -p 85:85 -e DB_TYPE=mysql -e POLL_INTERVAL=60 th0masis/mappdatabase:5_12
docker run --restar=always --name mappdatabase-01 -d -p 86:85 -e DB_TYPE=mysql -e POLL_INTERVAL=60 th0masis/mappdatabase:5_12
If database is on remote machine you need to expose port for container (-p 3306:3306)
podman run --restar=always --name mappdatabase-01 -d -p 85:85 -p 3306:3306 -e DB_HOST=192.168.1.123 -e DB_TYPE=mysql -e POLL_INTERVAL=60 th0masis/mappdatabase:5_12
Example mappDatabase for AS 6:
docker run --name mappdatabase-01 --restar=always -d -p 55002:85 -e DB_HOST=<ip-where-is-database> -e POLL_INTERVAL=20 th0masis/mappdatabase:6_0
Variable | Default Value | Description |
---|---|---|
APP_PORT | 85 | The port for mappdatabase in PLC |
DB_HOST | localhost | Hostname or IP address of the database server. |
DB_PORT | 3306 | Port of the database server |
DB_TYPE | mysql | type of the database (mysql ,mssql or postgress) |
POOL_INTERVAL | 60 | Interval in seconds for polling the database |
4. Steps after complete deploy
- check if forwarding between LAN and podman network is working
- check firewall rules
- check if systemd service is working if you use it
5. How to get status of container
logs:
docker logs mappdatabase-01
List of cintainers:
docker ps
docker ps -a