LibreTranslate/run.bat

42 lines
884 B
Batchfile
Raw Normal View History

2022-12-20 16:48:03 +00:00
@ECHO OFF
SETLOCAL
SET LT_PORT=5000
:loop
IF NOT "%1"=="" (
IF "%1"=="--port" (
SET LT_PORT=%2
SHIFT
)
IF "%1"=="--help" (
2023-01-13 15:14:31 +00:00
echo Usage: run.bat [--port N]
2022-12-20 16:48:03 +00:00
echo:
echo Run LibreTranslate using docker.
echo:
GOTO :done
)
IF "%1"=="--api-keys" (
SET DB_VOLUME=-v lt-db:/app/db
SHIFT
)
SHIFT
GOTO :loop
)
WHERE /Q docker
IF %ERRORLEVEL% NEQ 0 GOTO :install_docker
docker run -ti --rm -p %LT_PORT%:%LT_PORT% %DB_VOLUME% -v lt-local:/home/libretranslate/.local libretranslate/libretranslate %*
GOTO :done
:install_docker
2023-01-12 13:21:17 +00:00
ECHO Cannot find docker! Go to https://docs.docker.com/desktop/install/windows-install/ and install docker before running this script (pressing Enter will open the page)
2022-12-20 16:48:03 +00:00
pause
start "" https://docs.docker.com/desktop/install/windows-install/
GOTO :done
2023-01-12 13:21:17 +00:00
:done