Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5194a1dbb | ||
|
|
7c3d0e102f | ||
|
|
a0eaddf994 |
@@ -1,28 +0,0 @@
|
|||||||
# =============================================================================
|
|
||||||
# TFM aInventory - Central Network Configuration
|
|
||||||
# =============================================================================
|
|
||||||
# Use this file to customize the ports and IP address used by the application
|
|
||||||
# without needing to modify the source code.
|
|
||||||
#
|
|
||||||
# IMPORTANT: After modifying this file, restart the application for changes
|
|
||||||
# to take effect.
|
|
||||||
# =============================================================================
|
|
||||||
|
|
||||||
# The primary IP address where the application will be accessed.
|
|
||||||
# Used for CORS settings and documentation links.
|
|
||||||
SERVER_IP=192.168.84.113
|
|
||||||
|
|
||||||
# --- BACKEND PORTS ---
|
|
||||||
# Internal port for the FastAPI server (Backend)
|
|
||||||
BACKEND_PORT=8906
|
|
||||||
|
|
||||||
# External port for the Backend HTTPS Proxy (Caddy/local-ssl-proxy)
|
|
||||||
BACKEND_SSL_PORT=8908
|
|
||||||
|
|
||||||
# --- FRONTEND PORTS ---
|
|
||||||
# Internal port for the Next.js dev/prod server
|
|
||||||
FRONTEND_PORT=8907
|
|
||||||
|
|
||||||
# External port for the Frontend HTTPS Proxy (Caddy/local-ssl-proxy)
|
|
||||||
# This is the port you will use in your browser (e.g. https://192.168.84.113:8909)
|
|
||||||
FRONTEND_SSL_PORT=8909
|
|
||||||
25
deploy.sh
Executable file
25
deploy.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
# deploy.sh - Production Deployment Script for TFM aInventory
|
||||||
|
# Forces Docker Compose to use the inventory.env file for both host and container.
|
||||||
|
|
||||||
|
echo "🐳 TFM aInventory - Starting Deployment..."
|
||||||
|
|
||||||
|
# 1. Check for configuration file
|
||||||
|
if [ ! -f "inventory.env" ]; then
|
||||||
|
echo "❌ ERROR: inventory.env not found!"
|
||||||
|
echo "Please create it or use the template provided."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# 2. Source the env file for the current shell (helps some docker versions)
|
||||||
|
export $(grep -v '^#' inventory.env | xargs)
|
||||||
|
|
||||||
|
# 3. Run Docker Compose with explicit env-file flag
|
||||||
|
echo "🚀 Building and starting containers..."
|
||||||
|
docker compose --env-file inventory.env up -d --build --remove-orphans
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "✅ Deployment requested."
|
||||||
|
echo " Access URL: https://${SERVER_IP:-localhost}:${FRONTEND_SSL_PORT:-8919}"
|
||||||
|
echo " Run 'docker compose ps' to check status."
|
||||||
|
echo ""
|
||||||
@@ -8,7 +8,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- ${BACKEND_PORT:-8000}:8000
|
- ${BACKEND_PORT:-8000}:8000
|
||||||
env_file:
|
env_file:
|
||||||
- ./config/network_config.env
|
- inventory.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/app/data
|
- ./data:/app/data
|
||||||
- ./logs:/app/logs
|
- ./logs:/app/logs
|
||||||
@@ -28,7 +28,7 @@ services:
|
|||||||
ports:
|
ports:
|
||||||
- ${FRONTEND_PORT:-3000}:3000
|
- ${FRONTEND_PORT:-3000}:3000
|
||||||
env_file:
|
env_file:
|
||||||
- ./config/network_config.env
|
- inventory.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./logs:/app/logs
|
- ./logs:/app/logs
|
||||||
# Write Next.js logs to both stdout (docker logs) and file (mapped volume)
|
# Write Next.js logs to both stdout (docker logs) and file (mapped volume)
|
||||||
@@ -43,7 +43,7 @@ services:
|
|||||||
- ${BACKEND_SSL_PORT:-3002}:${BACKEND_SSL_PORT:-3002}
|
- ${BACKEND_SSL_PORT:-3002}:${BACKEND_SSL_PORT:-3002}
|
||||||
- ${FRONTEND_SSL_PORT:-3003}:${FRONTEND_SSL_PORT:-3003}
|
- ${FRONTEND_SSL_PORT:-3003}:${FRONTEND_SSL_PORT:-3003}
|
||||||
env_file:
|
env_file:
|
||||||
- ./config/network_config.env
|
- inventory.env
|
||||||
volumes:
|
volumes:
|
||||||
- ./config/Caddyfile:/etc/caddy/Caddyfile
|
- ./config/Caddyfile:/etc/caddy/Caddyfile
|
||||||
# Persist the internal Caddy certificates so users don't get new certificate warnings constantly
|
# Persist the internal Caddy certificates so users don't get new certificate warnings constantly
|
||||||
|
|||||||
@@ -29,7 +29,8 @@ cp install_service.sh "$PROD_DIR/"
|
|||||||
cp inventory.service.template "$PROD_DIR/"
|
cp inventory.service.template "$PROD_DIR/"
|
||||||
cp USER_GUIDE.md "$PROD_DIR/"
|
cp USER_GUIDE.md "$PROD_DIR/"
|
||||||
cp README.md "$PROD_DIR/INSTALLATION_GUIDE.md"
|
cp README.md "$PROD_DIR/INSTALLATION_GUIDE.md"
|
||||||
cp .env "$PROD_DIR/"
|
cp inventory.env "$PROD_DIR/"
|
||||||
|
cp deploy.sh "$PROD_DIR/"
|
||||||
cp .git_path "$PROD_DIR/" 2>/dev/null || true
|
cp .git_path "$PROD_DIR/" 2>/dev/null || true
|
||||||
cp frontend/VERSION.json "$PROD_DIR/"
|
cp frontend/VERSION.json "$PROD_DIR/"
|
||||||
cp frontend/VERSION.json "$PROD_DIR/frontend/"
|
cp frontend/VERSION.json "$PROD_DIR/frontend/"
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
{"version": "1.9.3", "last_build": "2026-04-13-2112", "codename": "PortFix", "commit": "2b8d0b3f"}
|
{"version": "1.9.6", "last_build": "2026-04-13-2136", "codename": "BundleFix", "commit": "7c3d0e10"}
|
||||||
|
|||||||
19
inventory.env
Normal file
19
inventory.env
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
# =============================================================================
|
||||||
|
# TFM aInventory - Docker Compose Environment
|
||||||
|
# =============================================================================
|
||||||
|
# This file is used by Docker Compose for host-side port mapping.
|
||||||
|
# It should match the values in config/network_config.env
|
||||||
|
# =============================================================================
|
||||||
|
|
||||||
|
SERVER_IP=192.168.84.113
|
||||||
|
|
||||||
|
# Backend Ports
|
||||||
|
BACKEND_PORT=8916
|
||||||
|
BACKEND_SSL_PORT=8918
|
||||||
|
|
||||||
|
# Frontend Ports
|
||||||
|
FRONTEND_PORT=8917
|
||||||
|
FRONTEND_SSL_PORT=8919
|
||||||
|
|
||||||
|
# Security
|
||||||
|
JWT_SECRET_KEY=change_me_in_production
|
||||||
@@ -7,7 +7,7 @@ echo "🚀 Starting TFM aInventory in Standalone Mode..."
|
|||||||
# Trapping termination signals to clean up child processes
|
# Trapping termination signals to clean up child processes
|
||||||
trap "echo 'Stopping all processes...'; kill 0" SIGINT SIGTERM EXIT
|
trap "echo 'Stopping all processes...'; kill 0" SIGINT SIGTERM EXIT
|
||||||
|
|
||||||
# --- CONFIGURATION (Default values, overridden by network_config.env) ---
|
# --- CONFIGURATION (Default values, overridden by network_configinventory.env) ---
|
||||||
BACKEND_PORT=8000
|
BACKEND_PORT=8000
|
||||||
FRONTEND_PORT=3001
|
FRONTEND_PORT=3001
|
||||||
BACKEND_SSL_PORT=3002
|
BACKEND_SSL_PORT=3002
|
||||||
@@ -15,7 +15,7 @@ FRONTEND_SSL_PORT=3003
|
|||||||
SERVER_IP="localhost"
|
SERVER_IP="localhost"
|
||||||
|
|
||||||
# Load Configuration from file if it exists
|
# Load Configuration from file if it exists
|
||||||
CONFIG_PATH="$(cd "$(dirname "$0")" && pwd)/config/network_config.env"
|
CONFIG_PATH="$(cd "$(dirname "$0")" && pwd)/inventory.env"
|
||||||
if [ -f "$CONFIG_PATH" ]; then
|
if [ -f "$CONFIG_PATH" ]; then
|
||||||
echo "⚙️ Loading network configuration from $CONFIG_PATH..."
|
echo "⚙️ Loading network configuration from $CONFIG_PATH..."
|
||||||
export $(grep -v '^#' "$CONFIG_PATH" | xargs)
|
export $(grep -v '^#' "$CONFIG_PATH" | xargs)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# --- CONFIGURATION (Default values, will be overridden by network_config.env) ---
|
# --- CONFIGURATION (Default values, will be overridden by network_configinventory.env) ---
|
||||||
BACKEND_PORT=8000
|
BACKEND_PORT=8000
|
||||||
FRONTEND_PORT=3001
|
FRONTEND_PORT=3001
|
||||||
BACKEND_SSL_PORT=3002
|
BACKEND_SSL_PORT=3002
|
||||||
@@ -8,10 +8,10 @@ FRONTEND_SSL_PORT=3003
|
|||||||
SERVER_IP="localhost"
|
SERVER_IP="localhost"
|
||||||
|
|
||||||
# Load Configuration from file if it exists
|
# Load Configuration from file if it exists
|
||||||
CONFIG_PATH="$(cd "$(dirname "$0")" && pwd)/config/network_config.env"
|
CONFIG_PATH="$(cd "$(dirname "$0")" && pwd)/inventory.env"
|
||||||
if [ -f "$CONFIG_PATH" ]; then
|
if [ -f "$CONFIG_PATH" ]; then
|
||||||
echo "⚙️ Loading network configuration from $CONFIG_PATH..."
|
echo "⚙️ Loading network configuration from $CONFIG_PATH..."
|
||||||
# Export variables from .env file (ignoring comments and empty lines)
|
# Export variables from inventory.env file (ignoring comments and empty lines)
|
||||||
export $(grep -v '^#' "$CONFIG_PATH" | xargs)
|
export $(grep -v '^#' "$CONFIG_PATH" | xargs)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user