fixed
This commit is contained in:
@@ -1,5 +1,3 @@
|
||||
version: '3.8'
|
||||
|
||||
services:
|
||||
# MongoDB Database
|
||||
mongodb:
|
||||
@@ -39,9 +37,6 @@ services:
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./backend/.env:/app/.env:ro
|
||||
- ./backend/config.py:/app/config.py:ro
|
||||
- ./backend/ollama_client.py:/app/ollama_client.py:ro
|
||||
- ./news_crawler:/app:ro
|
||||
networks:
|
||||
- munich-news-network
|
||||
healthcheck:
|
||||
@@ -92,8 +87,6 @@ services:
|
||||
- TZ=Europe/Berlin
|
||||
volumes:
|
||||
- ./backend/.env:/app/.env:ro
|
||||
- ./backend/services:/app/backend/services:ro
|
||||
- ./news_sender:/app:ro
|
||||
networks:
|
||||
- munich-news-network
|
||||
healthcheck:
|
||||
|
||||
@@ -2,17 +2,15 @@ FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY requirements.txt .
|
||||
# Copy requirements first for better caching
|
||||
COPY news_crawler/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy crawler files
|
||||
COPY . .
|
||||
# Copy backend config (needed for Config class)
|
||||
COPY backend/config.py /app/config.py
|
||||
|
||||
# Copy backend config files (needed for Config class)
|
||||
COPY ../backend/config.py /app/config.py
|
||||
COPY ../backend/ollama_client.py /app/ollama_client.py
|
||||
COPY ../backend/.env /app/.env
|
||||
# Copy crawler files (includes ollama_client.py)
|
||||
COPY news_crawler/ /app/
|
||||
|
||||
# Make the scheduler executable
|
||||
RUN chmod +x scheduled_crawler.py
|
||||
|
||||
@@ -2,16 +2,17 @@ FROM python:3.11-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install dependencies
|
||||
COPY requirements.txt .
|
||||
# Copy requirements first for better caching
|
||||
COPY news_sender/requirements.txt .
|
||||
RUN pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
# Copy sender files
|
||||
COPY . .
|
||||
# Copy backend dependencies (needed for tracking)
|
||||
COPY backend/services /app/backend/services
|
||||
COPY backend/database.py /app/backend/database.py
|
||||
COPY backend/config.py /app/backend/config.py
|
||||
|
||||
# Copy backend files (needed for tracking and config)
|
||||
COPY ../backend/services /app/backend/services
|
||||
COPY ../backend/.env /app/.env
|
||||
# Copy sender files
|
||||
COPY news_sender/ /app/
|
||||
|
||||
# Make the scheduler executable
|
||||
RUN chmod +x scheduled_sender.py
|
||||
|
||||
@@ -15,7 +15,11 @@ import sys
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Add backend directory to path for importing tracking service
|
||||
backend_dir = Path(__file__).parent.parent / 'backend'
|
||||
# Check if running in Docker (backend is at /app/backend) or locally (../backend)
|
||||
if Path('/app/backend').exists():
|
||||
backend_dir = Path('/app/backend')
|
||||
else:
|
||||
backend_dir = Path(__file__).parent.parent / 'backend'
|
||||
sys.path.insert(0, str(backend_dir))
|
||||
|
||||
# Import tracking modules
|
||||
|
||||
Reference in New Issue
Block a user