deploy: one-command scripts to build+run from deploy/.env
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Tail logs for the stack (or a single service, e.g. api / frontend / postgres).
|
||||
.EXAMPLE
|
||||
./deploy/logs.ps1 # all services
|
||||
./deploy/logs.ps1 api # just the API container
|
||||
#>
|
||||
param([string]$Service)
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$root = Split-Path -Parent $PSScriptRoot
|
||||
$envFile = Join-Path $PSScriptRoot '.env'
|
||||
|
||||
$composeArgs = @('compose', '--env-file', $envFile, 'logs', '-f', '--tail', '200')
|
||||
if ($Service) { $composeArgs += $Service }
|
||||
|
||||
Push-Location $root
|
||||
try { & docker @composeArgs }
|
||||
finally { Pop-Location }
|
||||
Reference in New Issue
Block a user