Sanjay / prepare_deployment.bat
TheDeepDas's picture
Yolo
6bbbfda
@echo off
REM Deployment script for Marine Pollution Detection API
REM This script cleans up unnecessary files and prepares for deployment
echo Starting deployment preparation...
REM 1. Remove all test files
echo Removing test files...
for /r %%i in (test_*.py) do del "%%i"
if exist test_files\ rd /s /q test_files
if exist test_output\ rd /s /q test_output
if exist tests\ rd /s /q tests
REM 2. Remove unnecessary Python files
echo Removing unnecessary Python files...
if exist debug_cloudinary.py del debug_cloudinary.py
if exist create_test_user.py del create_test_user.py
if exist generate_test_incidents.py del generate_test_incidents.py
if exist list_incidents.py del list_incidents.py
if exist train_models.py del train_models.py
REM 3. Remove smaller YOLOv8 models (we only need YOLOv8x)
echo Removing smaller YOLO models...
if exist yolov8n.pt del yolov8n.pt
if exist yolov8s.pt del yolov8s.pt
if exist yolov8m.pt del yolov8m.pt
if exist yolov8l.pt del yolov8l.pt
REM Note: Keep yolov8x.pt as it's required
REM 4. Use production Dockerfile and .dockerignore
echo Setting up production Docker files...
copy Dockerfile.prod Dockerfile /Y
copy .dockerignore.prod .dockerignore /Y
REM 5. Clean up Python cache files
echo Cleaning up Python cache files...
for /d /r %%i in (__pycache__) do rd /s /q "%%i"
for /r %%i in (*.pyc *.pyo *.pyd) do del "%%i"
for /d /r %%i in (.pytest_cache) do rd /s /q "%%i"
REM 6. Keep only necessary requirements
echo Setting up production requirements...
copy requirements.txt requirements.bak /Y
REM Use specific requirements file for deployment
copy requirements-docker.txt requirements.txt /Y
echo Deployment preparation completed successfully!
echo Use 'docker build -t marine-pollution-api .' to build the production container