feat: add new container for sperate web interface
This commit is contained in:
@@ -69,14 +69,13 @@ services:
|
||||
|
||||
# NFOGuard Web Interface
|
||||
nfoguard-web:
|
||||
build:
|
||||
context: ./nfoguard-web
|
||||
dockerfile: Dockerfile.web
|
||||
image: gitea.skalas.org/sbcrumb/nfoguard:latest # Same image as core!
|
||||
container_name: nfoguard-web
|
||||
restart: unless-stopped
|
||||
command: ["python", "nfoguard-web/main_web.py"] # Different entry point
|
||||
env_file:
|
||||
- nfoguard-web/.env.web.example
|
||||
- nfoguard-web/.env.secrets.web.example # Create this file
|
||||
- .env
|
||||
- .env.secrets
|
||||
environment:
|
||||
- TZ=${TZ:-America/New_York}
|
||||
- WEB_HOST=0.0.0.0
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
# ===========================================
|
||||
# NFOGuard Web Interface Secrets
|
||||
# ===========================================
|
||||
# SENSITIVE CONFIGURATION - DO NOT COMMIT TO VERSION CONTROL
|
||||
# Copy this file to .env.secrets and update with your actual values
|
||||
|
||||
# ===========================================
|
||||
# DATABASE CREDENTIALS
|
||||
# ===========================================
|
||||
# Database password for web interface access
|
||||
DB_PASSWORD=your_secure_database_password
|
||||
|
||||
# ===========================================
|
||||
# WEB AUTHENTICATION CREDENTIALS
|
||||
# ===========================================
|
||||
# Web interface authentication (if enabled)
|
||||
WEB_AUTH_PASSWORD=your_secure_web_password
|
||||
@@ -1,57 +0,0 @@
|
||||
# ===========================================
|
||||
# NFOGuard Web Interface Configuration
|
||||
# ===========================================
|
||||
# Configuration for the separated web interface container
|
||||
|
||||
# ===========================================
|
||||
# WEB SERVER SETTINGS
|
||||
# ===========================================
|
||||
# Web interface server configuration
|
||||
WEB_HOST=0.0.0.0
|
||||
WEB_PORT=8081
|
||||
WEB_WORKERS=1
|
||||
WEB_DEBUG=false
|
||||
|
||||
# Core NFOGuard API connection
|
||||
CORE_API_HOST=nfoguard
|
||||
CORE_API_PORT=8080
|
||||
|
||||
# ===========================================
|
||||
# DATABASE CONFIGURATION (READ ACCESS)
|
||||
# ===========================================
|
||||
# Same database as core NFOGuard but optimized for web queries
|
||||
DB_TYPE=postgresql
|
||||
DB_HOST=nfoguard-db
|
||||
DB_PORT=5432
|
||||
DB_NAME=nfoguard
|
||||
DB_USER=nfoguard
|
||||
# Set DB_PASSWORD in .env.secrets file
|
||||
|
||||
# ===========================================
|
||||
# WEB INTERFACE AUTHENTICATION
|
||||
# ===========================================
|
||||
# Optional authentication for web interface
|
||||
WEB_AUTH_ENABLED=false
|
||||
WEB_AUTH_USERNAME=admin
|
||||
# Set WEB_AUTH_PASSWORD in .env.secrets file
|
||||
WEB_AUTH_SESSION_TIMEOUT=3600
|
||||
|
||||
# ===========================================
|
||||
# UI CUSTOMIZATION
|
||||
# ===========================================
|
||||
# Application branding
|
||||
APP_TITLE=NFOGuard
|
||||
APP_SUBTITLE=Database Management & Reporting
|
||||
|
||||
# Interface settings
|
||||
PAGINATION_LIMIT=50
|
||||
REFRESH_INTERVAL=30
|
||||
|
||||
# Logo configuration
|
||||
LOGO_ENABLED=true
|
||||
|
||||
# ===========================================
|
||||
# TIMEZONE CONFIGURATION
|
||||
# ===========================================
|
||||
# Must match core NFOGuard timezone
|
||||
TZ=America/New_York
|
||||
@@ -1,40 +0,0 @@
|
||||
# NFOGuard Web Interface Container
|
||||
# Lightweight container for web interface only
|
||||
|
||||
FROM python:3.11-slim
|
||||
|
||||
# Set working directory
|
||||
WORKDIR /app
|
||||
|
||||
# Install system dependencies (minimal)
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libpq-dev \
|
||||
gcc \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Copy requirements and install Python dependencies
|
||||
COPY requirements_web.txt .
|
||||
RUN pip install --no-cache-dir -r requirements_web.txt
|
||||
|
||||
# Copy web application files
|
||||
COPY config/ ./config/
|
||||
COPY core/ ./core/
|
||||
COPY api/ ./api/
|
||||
COPY static/ ./static/
|
||||
COPY logo/ ./logo/
|
||||
COPY main_web.py .
|
||||
|
||||
# Create non-root user for security
|
||||
RUN adduser --disabled-password --gecos '' webuser && \
|
||||
chown -R webuser:webuser /app
|
||||
USER webuser
|
||||
|
||||
# Expose web interface port (configurable via WEB_PORT env var)
|
||||
EXPOSE 8081
|
||||
|
||||
# Health check for web interface
|
||||
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
|
||||
CMD curl -f http://localhost:${WEB_PORT:-8081}/ || exit 1
|
||||
|
||||
# Run web interface
|
||||
CMD ["python", "main_web.py"]
|
||||
@@ -1,15 +0,0 @@
|
||||
# NFOGuard Web Interface Dependencies
|
||||
# Minimal dependencies for web-only container
|
||||
|
||||
# Core web framework
|
||||
fastapi==0.104.1
|
||||
uvicorn[standard]==0.24.0
|
||||
|
||||
# Database connectivity
|
||||
psycopg2-binary==2.9.7
|
||||
|
||||
# Authentication and sessions
|
||||
python-multipart==0.0.6
|
||||
|
||||
# Utilities
|
||||
python-dotenv==1.0.0
|
||||
Reference in New Issue
Block a user