You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.4 KiB
2.4 KiB
Docker Setup for Digital Twin Monitoring
This document provides instructions for setting up and running the Digital Twin Monitoring application using Docker.
Prerequisites
- Ubuntu server
- Internet connection
- Basic knowledge of terminal commands
Quick Start
The easiest way to get started is to run the provided installation script:
chmod +x install.sh
./install.sh
This script will:
- Check if Docker is installed and install it if needed
- Build the Docker image
- Stop any existing containers with the same name
- Start a new container with the application
After running the script, the application will be available at http://[server-ip]:5003.
Manual Setup
If you prefer to set up manually, follow these steps:
1. Build the Docker image
docker build -t digital-twin-monitoring -f Docker/Dockerfile .
2. Run the Docker container
docker run -d \
--name digital-twin-monitoring \
--restart unless-stopped \
-p 5003:5003 \
--env-file .env \
digital-twin-monitoring
Environment Variables
The application uses the following environment variables from the .env file:
TELEGRAM_BOT_TOKEN: Token for Telegram bot notificationsTELEGRAM_CHAT_ID: Chat ID for Telegram notificationsDB_HOST_1: PostgreSQL host for tables: pf_parts, ms_equipment_masterDB_HOST_2: PostgreSQL host for table: dl_pi_fetch_lastDB_PORT: PostgreSQL portDB_USER: PostgreSQL usernameDB_PASS: PostgreSQL passwordDB_NAME: PostgreSQL database name
Make sure your .env file is properly configured before running the container.
Maintenance
Viewing logs
docker logs digital-twin-monitoring
Stopping the container
docker stop digital-twin-monitoring
Restarting the container
docker restart digital-twin-monitoring
Removing the container
docker stop digital-twin-monitoring
docker rm digital-twin-monitoring
Updating the application
To update the application, pull the latest code, rebuild the image, and restart the container:
git pull
docker build -t digital-twin-monitoring -f Docker/Dockerfile .
docker stop digital-twin-monitoring
docker rm digital-twin-monitoring
docker run -d \
--name digital-twin-monitoring \
--restart unless-stopped \
-p 5003:5003 \
--env-file .env \
digital-twin-monitoring