Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

docker update

tilakpatel225f778d75e859
diff --git a/.dockerignore b/.dockerignore
index 2a8c597c2..3481c46ac 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -1,17 +1,34 @@
+# Git files
+.git/
+.gitignore
+.gitattributes
+.gitmodules
+
+# Documentation
+README.md
+*.md
+docs/
+
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
+*$py.class
+*.so
# Distribution / packaging
build/
dist/
*.egg-info/
+*.egg
+MANIFEST
# Virtual environments
finceptvenv/
.venv/
env/
ENV/
+venv/
+.env
# Installer logs
pip-log.txt
@@ -21,24 +38,41 @@ pip-delete-this-directory.txt
htmlcov/
.tox/
.coverage
+.coverage.*
.cache
nosetests.xml
coverage.xml
+*.cover
+*.log
+.hypothesis/
+.pytest_cache/
# PyInstaller
*.spec
# macOS specific files
.DS_Store
+.AppleDouble
+.LSOverride
# Windows specific files
Thumbs.db
desktop.ini
+*.tmp
+*.temp
+
+# Linux specific files
+*~
# Tools and editors
.idea/
.vscode/
cmder/
+*.swp
+*.swo
+.vim/
+.emacs.d/
+*.sublime-*
# Output directories
Output/
@@ -49,4 +83,82 @@ setup.py
FinceptTerminal.exe
launcher.cpp
+# Docker files (don't copy these into the image)
+Dockerfile
+Dockerfile.*
+docker-compose*.yml
+.dockerignore
+
+# Development and testing
+tests/
+test/
+.pytest_cache/
+.mypy_cache/
+.bandit
+.flake8
+
+# Logs and databases
+*.log
+*.sqlite
+*.sqlite3
+*.db
+logs/
+*.pid
+
+# Runtime data
+data/
+cache/
+tmp/
+temp/
+
+# PDM specific (since you're using PDM)
+.pdm.toml
+.pdm-python
+__pypackages__/
+.pdm-build/
+
+# Node.js (if you have any JS assets)
+node_modules/
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# Jupyter Notebooks
+.ipynb_checkpoints
+
+# Environment variables (security)
+.env*
+!.env.example
+
+# OS generated files
+*.DS_Store
+.DS_Store?
+._*
+.Spotlight-V100
+.Trashes
+ehthumbs.db
+Thumbs.db
+
+# IDEs and editors
+*.sublime-project
+*.sublime-workspace
+.vscode/
+.idea/
+
+# Backup files
+*.bak
+*.backup
+*.old
+
+# Compiled extensions
+*.o
+*.a
+*.la
+*.lo
+*.lai
+*.so.*
+# Temporary files
+*.tmp
+*.temp
+*~
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
index 9cc4946be..5b23faf4b 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,40 +1,70 @@
-# Use the official Python image with Python 3.11
-FROM python:3.11-slim
+# Multi-stage build to reduce final image size
+FROM python:3.11-slim as builder
-ENV GDAL_VERSION=3.6.3
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
-ENV PYTHONPATH=/app/finceptTerminal
-
-WORKDIR /app
+ENV DEBIAN_FRONTEND=noninteractive
-# Install system dependencies (REMOVED qt5-default)
+# Install build dependencies in builder stage
RUN apt-get update && apt-get install -y --no-install-recommends \
gcc \
- gdal-bin \
- libgdal-dev \
- libpq-dev \
- libmariadb-dev \
+ g++ \
python3-dev \
build-essential \
pkg-config \
- libqt5webkit5-dev \
- libqt5webengine5 \
- libqt5webenginewidgets5 \
+ libpq-dev \
+ libmariadb-dev \
curl \
- && apt-get clean && rm -rf /var/lib/apt/lists/*
+ && rm -rf /var/lib/apt/lists/*
-# Install PDM for pyproject.toml-based dependency management
+# Install PDM
RUN pip install --no-cache-dir pdm
-# Copy pyproject only
+# Set working directory
+WORKDIR /app
+
+# Copy dependency files
COPY pyproject.toml README.md ./
-# Install dependencies via PDM
-RUN pdm install --no-editable --prod
+# Install dependencies to a specific location
+RUN pdm install --no-editable --prod --no-self
-# Copy the full project
+# Final stage - runtime image
+FROM python:3.11-slim
+
+ENV PYTHONDONTWRITEBYTECODE=1
+ENV PYTHONUNBUFFERED=1
+ENV PYTHONPATH=/app
+ENV DEBIAN_FRONTEND=noninteractive
+
+WORKDIR /app
+
+# Install only runtime dependencies (much smaller list)
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ libpq5 \
+ libmariadb3 \
+ curl \
+ && apt-get clean \
+ && rm -rf /var/lib/apt/lists/* \
+ && rm -rf /var/cache/apt/archives/* \
+ && rm -rf /tmp/* \
+ && rm -rf /var/tmp/*
+
+# Copy Python packages from builder stage
+COPY --from=builder /app/.venv /app/.venv
+
+# Copy application code
COPY . .
-# Run the app
-CMD ["pdm", "run", "python", "-m", "fincept_terminal.FinceptTerminalStart"]
+# Make sure we can run the virtual environment
+ENV PATH="/app/.venv/bin:$PATH"
+
+# Create non-root user for security
+RUN groupadd -r appuser && useradd -r -g appuser appuser
+RUN chown -R appuser:appuser /app
+USER appuser
+
+EXPOSE 8000
+
+# Run the application
+CMD ["python", "-m", "fincept_terminal.FinceptTerminalStart"]
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 4398312c9..7f707260f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,26 +14,42 @@ classifiers = [
]
dependencies = [
- "Pillow==11.2.1",
- "PyPDF2==2.12.1",
- "PyQt5==5.15.11",
- "datagovindia==1.0.2",
- "dearpygui==2.0.0",
- "feedparser==6.0.11",
- "fyers_apiv3==3.1.4",
- "numpy==2.2.6",
- "pandas==2.2.3",
- "psutil==7.0.0",
- "psycopg2==2.9.10",
- "pyotp==2.9.0",
- "requests==2.31.0",
- "scholarly==1.7.11",
- "scipy==1.15.3",
- "ta==0.11.0",
- "uuid==1.30",
- "wikipedia==1.4.0",
- "yfinance==0.2.61",
- "duckdb==1.3.2"
+ "Pillow>=11.0.0,<12.0.0",
+ "PyPDF2>=2.12.0,<4.0.0",
+ "PyQt5>=5.15.0,<6.0.0",
+ "datagovindia>=1.0.0,<2.0.0",
+ "dearpygui>=2.0.0,<3.0.0",
+ "feedparser>=6.0.0,<7.0.0",
+ "fyers_apiv3>=3.1.0,<4.0.0",
+ "numpy>=1.24.0,<3.0.0",
+ "pandas>=2.0.0,<3.0.0",
+ "psutil>=5.9.0,<8.0.0",
+ "psycopg2-binary>=2.9.0,<3.0.0",
+ "pyotp>=2.9.0,<3.0.0",
+ "requests>=2.31.0,<3.0.0",
+ "scholarly>=1.7.0,<2.0.0",
+ "scipy>=1.10.0,<2.0.0",
+ "ta>=0.11.0,<1.0.0",
+ "uuid>=1.30,<2.0.0",
+ "wikipedia>=1.4.0,<2.0.0",
+ "yfinance>=0.2.0,<1.0.0",
+ "duckdb>=1.0.0,<2.0.0",
+ # Additional dependencies for the AI hedge fund system
+ "asyncio-mqtt>=0.16.0,<1.0.0",
+ "aiohttp>=3.8.0,<4.0.0",
+ "redis>=5.0.0,<6.0.0",
+ "openai>=1.0.0,<2.0.0",
+ "textblob>=0.17.0,<1.0.0",
+]
+
+[project.optional-dependencies]
+dev = [
+ "pytest>=7.0.0",
+ "pytest-asyncio>=0.21.0",
+ "black>=23.0.0",
+ "isort>=5.12.0",
+ "flake8>=6.0.0",
+ "mypy>=1.5.0",
]
[tool.setuptools.packages.find]
@@ -44,4 +60,15 @@ fincept = "fincept_terminal.FinceptTerminalStart:start_terminal"
[build-system]
requires = ["pdm-backend"]
-build-backend = "pdm.backend"
\ No newline at end of file
+build-backend = "pdm.backend"
+
+[tool.pdm]
+distribution = true
+
+[tool.black]
+line-length = 100
+target-version = ['py311']
+
+[tool.isort]
+profile = "black"
+line_length = 100
\ No newline at end of file