mirror of
https://github.com/9technologygroup/patchmon.net.git
synced 2026-01-03 11:39:35 -06:00
fix(docker): copy agent files in docker bind mount if empty
This commit is contained in:
@@ -30,6 +30,7 @@ WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/backend /app/backend
|
||||
COPY --from=builder /app/node_modules /app/node_modules
|
||||
COPY --chown=node:node agents ./agents_backup
|
||||
COPY --chown=node:node agents ./agents
|
||||
COPY --chmod=755 docker/backend.docker-entrypoint.sh ./entrypoint.sh
|
||||
|
||||
|
||||
@@ -8,6 +8,18 @@ log() {
|
||||
echo "[$(date +'%Y-%m-%d %H:%M:%S')] $*" >&2
|
||||
}
|
||||
|
||||
# Copy files from agents_backup to agents if agents directory is empty
|
||||
if [ -d "/app/agents" ] && [ -z "$(ls -A /app/agents 2>/dev/null)" ]; then
|
||||
if [ -d "/app/agents_backup" ]; then
|
||||
log "Agents directory is empty, copying from backup..."
|
||||
cp -r /app/agents_backup/* /app/agents/
|
||||
else
|
||||
log "Warning: agents_backup directory not found"
|
||||
fi
|
||||
else
|
||||
log "Agents directory already contains files, skipping copy"
|
||||
fi
|
||||
|
||||
log "Starting PatchMon Backend..."
|
||||
|
||||
log "Running database migrations..."
|
||||
|
||||
Reference in New Issue
Block a user