20 lines
554 B
PowerShell
20 lines
554 B
PowerShell
<#
|
|
.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 }
|