Rewrite Powershell Scripts for Alternative Dockerfile

This commit is contained in:
Neal Chambers
2024-11-09 22:08:04 +09:00
parent 039399ee37
commit 477447ad92
2 changed files with 15 additions and 2 deletions

View File

@@ -1,5 +1,12 @@
Write-Host "Docker cleaning: remove old containers" -ForegroundColor Blue
docker compose down -v --remove-orphans
Write-Host "Docker build: set up the docker containers" -ForegroundColor Blue
docker compose build
# Check if an argument is provided
if ($args.Count -gt 0) {
# Run the build command with the argument and log output
docker build -f $1 .
} else {
docker compose build
}
Write-Host "Docker build finished"

View File

@@ -4,5 +4,11 @@
$DateTime=Get-Date -Format "yyyyMMdd-HHmmss"
docker/build-log.ps1 > log/build-$DateTime.log 2>&1
# Check if an argument is provided
if ($args.Count -gt 0) {
# Run the build command with the argument and log output
docker/build-log.ps1 $args[0] > log/build-$DateTime.log 2>&1
} else {
docker/build-log.ps1 > log/build-$DateTime.log 2>&1
}
docker/seed.ps1 > log/seed-$DateTime.log 2>&1