Last active
March 14, 2023 04:51
-
-
Save diginfo/9a721fda6b26acbfd30a1c2890b1a3e8 to your computer and use it in GitHub Desktop.
VPAS Docker Setup Script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:: ################### | |
:: ### VPAS DOCKER ### | |
:: ################### | |
:: wget -A "*.bat" - r <raw url> | |
@echo off | |
:: Define Vars | |
:: ########### | |
set "DIR=C:\docker\vpas" | |
:: Prompt for Local Port | |
:: ##################### | |
set /p "LOCPORT=Enter Local HTTP PORT? " | |
echo Installing to %DIR% on Port %LOCPORT% | |
:: Pull in latest (user will be prompted for api key) | |
:: ################################################# | |
docker login -u diginfo | |
docker pull diginfo/vpas | |
:: DO NOT add files and folders if they alreay exist | |
:: ################################################# | |
if not exist "%DIR%\config.json" ( | |
mkdir "%DIR%\log" | |
docker stop vpas | |
echo "rm" | |
docker container rm -f vpas | |
echo "Docker run..." | |
docker run -d --name vpas diginfo/vpas | |
:: Copy internal folders to local once | |
:: ################################### | |
echo "Extracting /public..." | |
docker cp vpas:/usr/share/dis/vpas/public "%DIR%" | |
echo "Extracting /sql..." | |
docker cp vpas:/usr/share/dis/vpas/sql "%DIR%" | |
echo "Extracting /prpt..." | |
docker cp vpas:/usr/share/dis/vpas/prpt "%DIR%" | |
echo "Extracting /templates..." | |
docker cp vpas:/usr/share/dis/vpas/templates "%DIR%" | |
echo "Extracting /pentaho logs..." | |
docker cp vpas:/usr/share/dis/pho/log "%DIR%/log" | |
echo "Extracting config.json" | |
docker cp vpas:/usr/share/dis/vpas/config.json "%DIR%" | |
docker stop vpas | |
) | |
:: Stop and remove any existing containers | |
:: ################################################# | |
echo "Stopping Temp Container..." | |
docker stop vpas | |
docker rm -f vpas | |
:: Now Create the Container and start it. | |
:: ################################################# | |
echo "Creating & Running container" | |
docker run -d --name vpas ^ | |
--restart unless-stopped ^ | |
--mount type=bind,target=/usr/share/dis/vpas/public,source="%DIR%\public" ^ | |
--mount type=bind,target=/usr/share/dis/vpas/sql,source="%DIR%\sql" ^ | |
--mount type=bind,target=/usr/share/dis/vpas/prpt,source="%DIR%\prpt" ^ | |
--mount type=bind,target=/usr/share/dis/pho/log,source="%DIR%\log" ^ | |
--mount type=bind,target=/usr/share/dis/vpas/templates,source="%DIR%\templates" ^ | |
--mount type=bind,target=/usr/share/dis/vpas/config.json,source="%DIR%\config.json" ^ | |
-p %LOCPORT%:8888 ^ | |
diginfo/vpas | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment