Ver código fonte

proxy network added

master
Daniel Covington 2 semanas atrás
pai
commit
44b22308bb
6 arquivos alterados com 130 adições e 2 exclusões
  1. +9
    -1
      .claude/settings.local.json
  2. +21
    -0
      .env_prod
  3. +1
    -0
      .gitignore
  4. +7
    -0
      docker-compose.yml
  5. +91
    -0
      docker-publish.ps1
  6. +1
    -1
      storage/cron-settings.json

+ 9
- 1
.claude/settings.local.json Ver arquivo

@@ -30,7 +30,15 @@
"Bash(docker compose *)",
"Bash(docker exec *)",
"PowerShell(docker exec kci-php-kanban-app-1 ls -la /var/www/html/storage/)",
"PowerShell(docker exec kci-php-kanban-app-1 cat /var/www/html/storage/import.log)"
"PowerShell(docker exec kci-php-kanban-app-1 cat /var/www/html/storage/import.log)",
"Bash(Get-ChildItem -Path \"d:\\\\Development\\\\PHP\\\\KCI-PHP-KANBAN\" -Force)",
"Bash(Select-Object Name, PSIsContainer)",
"Bash(Sort-Object Name)",
"WebFetch(domain:onefortheroadgit.sytes.net)",
"Bash(Get-ChildItem \"C:\\\\Temp\\\\KCI-CAMPAIGN-TRACKER-ref\" -Force)",
"Bash(Select-Object Name, LastWriteTime)",
"Bash(ls -la /mnt/c/Temp/KCI-CAMPAIGN-TRACKER-ref/)",
"Read(//mnt/c/Temp/**)"
]
}
}

+ 21
- 0
.env_prod Ver arquivo

@@ -0,0 +1,21 @@
APP_ENV=production
APP_DEBUG=false
# Update APP_URL to the production server hostname/IP and port
APP_URL=http://192.168.1.200:8080

# Keycloak SSO
KEYCLOAK_BASE_URL=http://kci-app01.ntp.kentcommunications.com:8180
KEYCLOAK_REALM=KCI
KEYCLOAK_CLIENT_ID=canopy-web
KEYCLOAK_CLIENT_SECRET=LHWXp5UUuES00Dz2iCjTJJgX9su6co0y
# Update redirect URIs to match APP_URL above
KEYCLOAK_REDIRECT_URI=http://192.168.1.200:8080/auth/callback
KEYCLOAK_LOGOUT_REDIRECT_URI=http://192.168.1.200:8080/login

# PrintStream SQL Server
PRINTSTREAM_HOST=192.168.1.197
PRINTSTREAM_PORT=1433
PRINTSTREAM_DATABASE=Livedata_dosrun
PRINTSTREAM_USER=sa
PRINTSTREAM_PASSWORD=ch@rt3r
IMPORT_RUN_EVERY_MINUTES=30

+ 1
- 0
.gitignore Ver arquivo

@@ -2,6 +2,7 @@
.env
.env.local
.env.*
!.env_prod
*.log
.DS_Store
.idea/


+ 7
- 0
docker-compose.yml Ver arquivo

@@ -1,6 +1,7 @@
services:
app:
build: .
container_name: kci-kanban-app
ports:
- "8080:80"
volumes:
@@ -11,3 +12,9 @@ services:
# Set PRINTSTREAM_HOST to the server's IP address in .env
# (Docker cannot resolve Windows LAN hostnames by name).
- "KCI-PS-2024:${PRINTSTREAM_HOST}"
networks:
- proxy

networks:
proxy:
external: true

+ 91
- 0
docker-publish.ps1 Ver arquivo

@@ -0,0 +1,91 @@
#Requires -Version 5.1
<#
.SYNOPSIS
Pulls the repo on the server, copies .env_prod as .env, then starts the container.
.EXAMPLE
.\docker-publish.ps1
.\docker-publish.ps1 -SshKey "~/.ssh/id_rsa"
#>

param(
[string]$SshKey = ""
)

Set-StrictMode -Version Latest
$ErrorActionPreference = "Stop"

# ---------------------------------------------------------------------------
# Configuration
# ---------------------------------------------------------------------------
$SSH_HOST = "192.168.1.200"
$SSH_USER = "root"
$REPO_PATH = "/root/kanban"
$REPO_URL = "https://onefortheroadgit.sytes.net/dcovington/KCI-PHP-KANBAN.git"

# ---------------------------------------------------------------------------
# Helpers
# ---------------------------------------------------------------------------
function Write-Step([string]$msg) {
Write-Host "`n==> $msg" -ForegroundColor Cyan
}

function Get-BaseArgs {
$a = @("-o", "StrictHostKeyChecking=accept-new")
if ($SshKey -ne "") { $a += @("-i", $SshKey) }
return $a
}

# Deploy whichever branch is currently checked out locally.
$BRANCH = (git rev-parse --abbrev-ref HEAD).Trim()
Write-Host "Branch: $BRANCH" -ForegroundColor Yellow

# ---------------------------------------------------------------------------
# Step 1 — clone or pull the repo (first password prompt)
# ---------------------------------------------------------------------------
Write-Step "Syncing repo on $SSH_USER@$SSH_HOST"

$prepCmd = "set -e; "
$prepCmd += "if [ -d '$REPO_PATH/.git' ]; then "
$prepCmd += "cd '$REPO_PATH' && git fetch origin && git checkout $BRANCH && git pull origin $BRANCH; "
$prepCmd += "else "
$prepCmd += "git clone --branch $BRANCH '$REPO_URL' '$REPO_PATH'; "
$prepCmd += "fi"

$sshArgs = Get-BaseArgs
$sshArgs += "$SSH_USER@$SSH_HOST", $prepCmd
ssh @sshArgs
if ($LASTEXITCODE -ne 0) { Write-Error "Repo sync failed (exit $LASTEXITCODE)." }

# ---------------------------------------------------------------------------
# Step 2 — copy .env_prod as .env into the now-existing repo dir (second prompt)
# ---------------------------------------------------------------------------
Write-Step "Copying .env_prod to $SSH_USER@$SSH_HOST as .env"
$scpArgs = Get-BaseArgs
$scpArgs += ".env_prod", "${SSH_USER}@${SSH_HOST}:${REPO_PATH}/.env"
scp @scpArgs
if ($LASTEXITCODE -ne 0) { Write-Error "scp failed (exit $LASTEXITCODE)." }

# ---------------------------------------------------------------------------
# Step 3 — copy the SQLite database (third password prompt)
# ---------------------------------------------------------------------------
Write-Step "Copying database/app.sqlite to $SSH_USER@$SSH_HOST"
$scpDbArgs = Get-BaseArgs
$scpDbArgs += "database/app.sqlite", "${SSH_USER}@${SSH_HOST}:${REPO_PATH}/database/app.sqlite"
scp @scpDbArgs
if ($LASTEXITCODE -ne 0) { Write-Error "scp database failed (exit $LASTEXITCODE)." }

# ---------------------------------------------------------------------------
# Step 4 — start the container (fourth password prompt)
# ---------------------------------------------------------------------------
Write-Step "Starting container on $SSH_USER@$SSH_HOST"

$deployCmd = "set -e; "
$deployCmd += "docker rm -f kci-kanban-app 2>/dev/null || true; "
$deployCmd += "cd '$REPO_PATH' && docker compose up -d --build --wait"

$sshArgs = Get-BaseArgs
$sshArgs += "$SSH_USER@$SSH_HOST", $deployCmd
ssh @sshArgs
if ($LASTEXITCODE -ne 0) { Write-Error "Deployment failed (exit $LASTEXITCODE)." }

Write-Host "`nDone. KCI Kanban is running on $SSH_HOST." -ForegroundColor Green

+ 1
- 1
storage/cron-settings.json Ver arquivo

@@ -1,5 +1,5 @@
{
"enabled": true,
"interval_minutes": 60,
"last_run": "2026-06-04 13:19:01"
"last_run": "2026-06-04 15:20:01"
}

Carregando…
Cancelar
Salvar

Powered by TurnKey Linux.