diff --git a/backend/.dockerignore b/backend/.dockerignore index 03ae3be..bf231a5 100644 --- a/backend/.dockerignore +++ b/backend/.dockerignore @@ -1,4 +1,5 @@ -# Python +# Python - exclude ALL __pycache__ directories (not just root level) +**/__pycache__/ __pycache__/ *.py[cod] *$py.class diff --git a/backend/Dockerfile b/backend/Dockerfile index 079f034..09e37f9 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -22,6 +22,11 @@ RUN pip install --no-cache-dir -r requirements.txt # Copy project COPY . . +# Remove any cached Python bytecode that might have been copied +# This ensures fresh .py files are always used +RUN find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true +RUN find . -name "*.pyc" -delete 2>/dev/null || true + # Make startup script executable RUN chmod +x startup.sh diff --git a/backend/deploy-apprunner-dev.sh b/backend/deploy-apprunner-dev.sh index 7298cc2..4d9bec0 100755 --- a/backend/deploy-apprunner-dev.sh +++ b/backend/deploy-apprunner-dev.sh @@ -72,8 +72,7 @@ if aws apprunner describe-service --service-arn arn:aws:apprunner:$REGION:$ACCOU "GITHUB_ENCRYPTION_KEY": "$SSM_PREFIX/$SSM_ENV/github_encryption_key", "GITHUB_REPO_TO_STAR": "$SSM_PREFIX/$SSM_ENV/github_repo_to_star", "RECAPTCHA_PUBLIC_KEY": "$SSM_PREFIX/$SSM_ENV/recaptcha_public_key", - "RECAPTCHA_PRIVATE_KEY": "$SSM_PREFIX/$SSM_ENV/recaptcha_private_key", - "CRON_SYNC_TOKEN": "$SSM_PREFIX/$SSM_ENV/cron_sync_token" + "RECAPTCHA_PRIVATE_KEY": "$SSM_PREFIX/$SSM_ENV/recaptcha_private_key" }, "StartCommand": "./startup.sh gunicorn --bind 0.0.0.0:8000 --timeout 180 --workers 2 tally.wsgi:application" }, @@ -228,8 +227,7 @@ EOF "GITHUB_ENCRYPTION_KEY": "$SSM_PREFIX/$SSM_ENV/github_encryption_key", "GITHUB_REPO_TO_STAR": "$SSM_PREFIX/$SSM_ENV/github_repo_to_star", "RECAPTCHA_PUBLIC_KEY": "$SSM_PREFIX/$SSM_ENV/recaptcha_public_key", - "RECAPTCHA_PRIVATE_KEY": "$SSM_PREFIX/$SSM_ENV/recaptcha_private_key", - "CRON_SYNC_TOKEN": "$SSM_PREFIX/$SSM_ENV/cron_sync_token" + "RECAPTCHA_PRIVATE_KEY": "$SSM_PREFIX/$SSM_ENV/recaptcha_private_key" }, "StartCommand": "./startup.sh gunicorn --bind 0.0.0.0:8000 --timeout 180 --workers 2 tally.wsgi:application" },