|
|
5 months ago | |
|---|---|---|
| .. | ||
| Dockerfile | 5 months ago | |
| README.md | 5 months ago | |
| docker-compose.yml | 5 months ago | |
README.md
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
Alternatively, you can use Docker Compose:
cd Docker
docker compose up -d
After running either method, 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
Using Docker Compose (Recommended)
To update the application using Docker Compose, simply pull the latest code and restart the services:
git pull
cd Docker
docker compose up -d
This will automatically rebuild the image if needed and restart the container with the updated code.
Using Docker Commands
Alternatively, you can update using individual Docker commands:
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