Skip to content

Commit

Permalink
Rewrite Powershell Scripts for Alternative Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
macanudo527 committed Nov 9, 2024
1 parent 361f212 commit f8e0c7f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
9 changes: 8 additions & 1 deletion docker/build-log.ps1
Original file line number Diff line number Diff line change
@@ -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"
8 changes: 7 additions & 1 deletion docker/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit f8e0c7f

Please sign in to comment.