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 deleted

tilakpatel22b579a510a9bb
diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml
deleted file mode 100644
index 5a93134ca..000000000
--- a/.github/workflows/docker-image.yml
+++ /dev/null
@@ -1,217 +0,0 @@
-name: Docker Image CI
-
-on:
- push:
- branches: [ "main", "develop" ]
- pull_request:
- branches: [ "main" ]
- workflow_dispatch: # Allow manual triggering
-
-env:
- REGISTRY: ghcr.io
- IMAGE_NAME: ${{ github.repository }}
-
-jobs:
- build:
- runs-on: ubuntu-latest
- permissions:
- contents: read
- packages: write
- security-events: write # For security scanning
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - name: Free up disk space
- run: |
- sudo rm -rf /usr/local/lib/android
- sudo rm -rf /usr/share/dotnet
- sudo rm -rf /opt/ghc
- sudo rm -rf /usr/local/share/boost
- sudo apt-get clean
- docker system prune -af
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
- with:
- driver-opts: |
- network=host
-
- - name: Log in to Container Registry
- if: github.event_name != 'pull_request'
- uses: docker/login-action@v3
- with:
- registry: ${{ env.REGISTRY }}
- username: ${{ github.actor }}
- password: ${{ secrets.GITHUB_TOKEN }}
-
- - name: Extract metadata
- id: meta
- uses: docker/metadata-action@v5
- with:
- images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
- tags: |
- type=ref,event=branch
- type=ref,event=pr
- type=sha,prefix={{branch}}-
- type=raw,value=latest,enable={{is_default_branch}}
-
- - name: Build and push Docker image
- uses: docker/build-push-action@v5
- with:
- context: .
- file: ./Dockerfile.optimized
- push: ${{ github.event_name != 'pull_request' }}
- tags: ${{ steps.meta.outputs.tags }}
- labels: ${{ steps.meta.outputs.labels }}
- cache-from: type=gha
- cache-to: type=gha,mode=max
- platforms: linux/amd64
- build-args: |
- BUILDKIT_INLINE_CACHE=1
-
- - name: Image size check
- if: github.event_name != 'pull_request'
- run: |
- # Get the latest tag for size checking
- LATEST_TAG="${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest"
- docker pull $LATEST_TAG
- IMAGE_SIZE=$(docker images $LATEST_TAG --format "table {{.Size}}" | tail -n +2)
- echo "Final image size: $IMAGE_SIZE"
-
- # Convert size to MB for comparison (rough estimation)
- if echo $IMAGE_SIZE | grep -q "GB"; then
- SIZE_NUM=$(echo $IMAGE_SIZE | sed 's/GB.*//')
- if (( $(echo "$SIZE_NUM > 2" | bc -l) )); then
- echo "Warning: Image size ($IMAGE_SIZE) is larger than 2GB"
- echo "Consider further optimization"
- else
- echo "Image size is acceptable: $IMAGE_SIZE"
- fi
- else
- echo "Image size is acceptable: $IMAGE_SIZE"
- fi
-
- test:
- runs-on: ubuntu-latest
- needs: build
- if: github.event_name == 'pull_request'
-
- steps:
- - name: Checkout repository
- uses: actions/checkout@v4
-
- - name: Free up disk space
- run: |
- sudo rm -rf /usr/local/lib/android
- sudo rm -rf /usr/share/dotnet
- docker system prune -af
-
- - name: Set up Docker Buildx
- uses: docker/setup-buildx-action@v3
-
- - name: Build test image
- uses: docker/build-push-action@v5
- with:
- context: .
- file: ./Dockerfile.optimized
- load: true
- tags: test-image:latest
- cache-from: type=gha
-
- - name: Test Docker image basic functionality
- run: |
- echo "Testing if optimized container starts successfully..."
- docker run --rm test-image:latest python -c "
- import sys
- print('Python version:', sys.version)
- print('Container test passed!')
-
- # Test core imports that should be available
- try:
- import pandas as pd
- import numpy as np
- import requests
- print('Core dependencies imported successfully')
- except ImportError as e:
- print('Import failed:', e)
- sys.exit(1)
- "
-
- - name: Test application structure
- run: |
- echo "Testing application structure..."
- docker run --rm test-image:latest python -c "
- import sys
- import os
-
- # Check if application files exist
- app_files = [
- '/app/fincept_terminal',
- '/app/pyproject.toml'
- ]
-
- for file_path in app_files:
- if os.path.exists(file_path):
- print(f'{file_path} exists')
- else:
- print(f'{file_path} not found')
-
- # Test virtual environment
- if os.path.exists('/app/.venv'):
- print('Virtual environment found')
- else:
- print('Virtual environment not found')
- "
-
- - name: Check final image size
- run: |
- SIZE=$(docker images test-image:latest --format "table {{.Size}}" | tail -n +2)
- echo "Final optimized image size: $SIZE"
- echo "size=$SIZE" >> $GITHUB_OUTPUT
-
- security-scan:
- runs-on: ubuntu-latest
- needs: build
- if: github.event_name != 'pull_request'
-
- steps:
- - name: Run Trivy vulnerability scanner
- uses: aquasecurity/trivy-action@master
- with:
- image-ref: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
- format: 'sarif'
- output: 'trivy-results.sarif'
-
- - name: Upload Trivy scan results to GitHub Security tab
- uses: github/codeql-action/upload-sarif@v3
- if: always()
- with:
- sarif_file: 'trivy-results.sarif'
-
- notify:
- runs-on: ubuntu-latest
- needs: [build, security-scan]
- if: always() && github.event_name != 'pull_request'
-
- steps:
- - name: Build Status Summary
- run: |
- echo "## Docker Build Summary" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "| Component | Status |" >> $GITHUB_STEP_SUMMARY
- echo "|-----------|--------|" >> $GITHUB_STEP_SUMMARY
- echo "| Build | ${{ needs.build.result == 'success' && 'Success' || 'Failed' }} |" >> $GITHUB_STEP_SUMMARY
- echo "| Security Scan | ${{ needs.security-scan.result == 'success' && 'Passed' || 'Issues Found' }} |" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "### Usage:" >> $GITHUB_STEP_SUMMARY
- echo "\`\`\`bash" >> $GITHUB_STEP_SUMMARY
- echo "# Pull the optimized image" >> $GITHUB_STEP_SUMMARY
- echo "docker pull ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "# Run the container" >> $GITHUB_STEP_SUMMARY
- echo "docker run -p 8000:8000 ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest" >> $GITHUB_STEP_SUMMARY
- echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
- echo "" >> $GITHUB_STEP_SUMMARY
- echo "Expected image size: 800MB-1.2GB (down from 10GB)" >> $GITHUB_STEP_SUMMAR
\ No newline at end of file