-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFileEX.ps1
More file actions
53 lines (49 loc) · 1.6 KB
/
FileEX.ps1
File metadata and controls
53 lines (49 loc) · 1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/usr/bin/env pwsh
# FileEX Docker Compose Manager
# Run this script from anywhere to manage your FileEX container
param(
[Parameter(Position=0)]
[ValidateSet("up", "down", "restart", "logs", "status", "build", "pull")]
[string]$Action = "up"
)
# Set the directory where your docker-compose.yaml is located
# Uses the script's own directory to ensure it works regardless of where it's called from
$ComposeDir = "Change To Your Docker Compose Directory"
# Change to the compose directory
Push-Location $ComposeDir
try {
switch ($Action) {
"up" {
Write-Host "Starting FileEX..." -ForegroundColor Green
docker compose up -d
Write-Host "`nFileEX is running at http://localhost:6979" -ForegroundColor Cyan
}
"down" {
Write-Host "Stopping FileEX..." -ForegroundColor Yellow
docker compose down
}
"restart" {
Write-Host "Restarting FileEX..." -ForegroundColor Yellow
docker compose restart
}
"logs" {
Write-Host "Showing logs (Ctrl+C to exit)..." -ForegroundColor Cyan
docker compose logs -f
}
"status" {
Write-Host "FileEX Status:" -ForegroundColor Cyan
docker compose ps
}
"build" {
Write-Host "Building FileEX..." -ForegroundColor Green
docker compose build
}
"pull" {
Write-Host "Pulling latest image..." -ForegroundColor Green
docker compose pull
}
}
} finally {
# Return to original directory
Pop-Location
}