Files
light/build-with-docker.bat

38 lines
879 B
Batchfile
Raw Normal View History

2025-10-15 23:41:09 +08:00
@echo off
setlocal
echo Building Light Delivery application with Docker...
REM 第一步:编译项目
echo Step 1: Compiling the project...
call mvn clean package -DskipTests
if %errorlevel% neq 0 (
echo Error: Maven build failed
exit /b %errorlevel%
)
REM 第二步:构建 Docker 镜像
echo Step 2: Building Docker image...
docker build -t light-delivery-app .
if %errorlevel% neq 0 (
echo Error: Docker build failed
exit /b %errorlevel%
)
REM 第三步:验证镜像
echo Step 3: Verifying Docker image...
docker images | findstr light-delivery-app
echo.
echo Build completed successfully!
echo.
echo To run the container locally:
echo docker run -d --name light-delivery -p 8080:8080 -p 8443:8443 light-delivery-app
echo.
echo To export the image for cloud deployment:
echo docker save light-delivery-app -o light-delivery-app.tar
echo.
pause