fixed
This commit is contained in:
@@ -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