updated frontend
This commit is contained in:
@@ -8,14 +8,14 @@ set "ARCHIVE_FILE=%IMAGE_OUT_DIR%\webstore-production-images.tar"
|
||||
set "API_IMAGE=webstore-api:prod"
|
||||
set "DB_IMAGE=postgres:16-alpine"
|
||||
|
||||
echo [1/6] Checking Docker availability...
|
||||
echo [1/7] Checking Docker availability...
|
||||
docker --version >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Docker CLI is not available. Install Docker Desktop first.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [2/6] Building production API image: %API_IMAGE%
|
||||
echo [2/7] Building production API image: %API_IMAGE%
|
||||
pushd "%ROOT_DIR%" >nul
|
||||
docker build -t "%API_IMAGE%" -f Dockerfile .
|
||||
if errorlevel 1 (
|
||||
@@ -25,17 +25,33 @@ if errorlevel 1 (
|
||||
)
|
||||
popd >nul
|
||||
|
||||
echo [3/6] Pulling database image: %DB_IMAGE%
|
||||
echo [3/7] Pulling database image: %DB_IMAGE%
|
||||
docker pull "%DB_IMAGE%"
|
||||
if errorlevel 1 (
|
||||
echo ERROR: Failed to pull database image.
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [4/6] Preparing image output directory: %IMAGE_OUT_DIR%
|
||||
echo [4/7] Preparing image output directory: %IMAGE_OUT_DIR%
|
||||
if not exist "%IMAGE_OUT_DIR%" mkdir "%IMAGE_OUT_DIR%"
|
||||
|
||||
echo [5/6] Exporting images to archive...
|
||||
echo [5/7] Creating placeholder product images...
|
||||
pushd "%ROOT_DIR%" >nul
|
||||
|
||||
REM Create uploads directory
|
||||
if not exist "%IMAGE_OUT_DIR%\uploads" mkdir "%IMAGE_OUT_DIR%\uploads"
|
||||
|
||||
REM Use Node.js to generate placeholder images reliably
|
||||
echo Generating placeholder images using Node.js...
|
||||
node "%ROOT_DIR%\scripts\generate-placeholder-images.js"
|
||||
if errorlevel 1 (
|
||||
echo WARNING: Could not generate placeholder images automatically
|
||||
echo Note: Images can be added manually to %IMAGE_OUT_DIR%
|
||||
)
|
||||
|
||||
popd >nul
|
||||
|
||||
echo [6/7] Exporting images to archive...
|
||||
if exist "%ARCHIVE_FILE%" del /f /q "%ARCHIVE_FILE%"
|
||||
docker save -o "%ARCHIVE_FILE%" "%API_IMAGE%" "%DB_IMAGE%"
|
||||
if errorlevel 1 (
|
||||
@@ -43,7 +59,35 @@ if errorlevel 1 (
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo [6/6] Done.
|
||||
echo [7/7] Done.
|
||||
echo.
|
||||
echo ========================================
|
||||
echo PRODUCTION BUILD COMPLETE
|
||||
echo ========================================
|
||||
echo.
|
||||
echo Created archive: "%ARCHIVE_FILE%"
|
||||
echo Share this file with students together with production.compose.yml and .production.env.
|
||||
echo.
|
||||
echo FILES TO DISTRIBUTE TO STUDENTS:
|
||||
echo 1. "%ARCHIVE_FILE%"
|
||||
echo 2. "%IMAGE_OUT_DIR%\production.compose.yml"
|
||||
echo 3. "%IMAGE_OUT_DIR%\.production.env" (with proper configuration)
|
||||
echo 4. "%IMAGE_OUT_DIR%\run-student-production.bat"
|
||||
echo.
|
||||
echo WHAT'S INCLUDED:
|
||||
echo - Production API Docker image
|
||||
echo - PostgreSQL database image
|
||||
echo - Initial seeding script (creates 5 categories, 16 products, 3 test users)
|
||||
echo - Placeholder product images (17 images)
|
||||
echo - Upload directory for student-generated images
|
||||
echo.
|
||||
echo STUDENTS SHOULD:
|
||||
echo 1. Extract webstore-production-images.tar
|
||||
echo 2. Copy .production.env and configure database credentials
|
||||
echo 3. Run run-student-production.bat
|
||||
echo 4. Database will auto-seed with sample data
|
||||
echo 5. Test users available:
|
||||
echo - admin@test.com / admin123
|
||||
echo - john@test.com / password123
|
||||
echo - jane@test.com / password123
|
||||
echo.
|
||||
exit /b 0
|
||||
Reference in New Issue
Block a user