@echo off chcp 65001 >nul 2>&1 setlocal cd /d "%~dp0" where go >nul 2>nul if errorlevel 1 ( echo [ERROR] Go not found in PATH. Install Go and reopen the terminal. pause exit /b 1 ) set "DIST=dist" if not exist "%DIST%" mkdir "%DIST%" set "GOOS=linux" set "GOARCH=amd64" set "CGO_ENABLED=0" echo Cross-compile linux/amd64 -^> "%DIST%\mengyaping-backend" go version go build -trimpath -ldflags="-s -w" -o "%DIST%\mengyaping-backend" . if errorlevel 1 ( echo. echo [ERROR] go build failed. See messages above. echo Tips: go.mod requires Go 1.25+; run from mengyaping-backend folder. pause exit /b 1 ) echo. echo [OK] "%CD%\%DIST%\mengyaping-backend" echo Next: copy this folder to server, then: docker compose build endlocal exit /b 0