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.
ariwahyunahar f5a3e523bd docker file updated 5 months ago
..
Dockerfile docker file updated 5 months ago
README.md docker file updated 5 months ago
docker-compose.yml docker file updated 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:

  1. Check if Docker is installed and install it if needed
  2. Build the Docker image
  3. Stop any existing containers with the same name
  4. 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 notifications
  • TELEGRAM_CHAT_ID: Chat ID for Telegram notifications
  • DB_HOST_1: PostgreSQL host for tables: pf_parts, ms_equipment_master
  • DB_HOST_2: PostgreSQL host for table: dl_pi_fetch_last
  • DB_PORT: PostgreSQL port
  • DB_USER: PostgreSQL username
  • DB_PASS: PostgreSQL password
  • DB_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 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