Fix docker build context permanently via .dockerignore + tar verify
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
#!/usr/bin/env bash
|
||||
# Engångsfix på servern om docker build context failar
|
||||
set -euo pipefail
|
||||
NODERED_DIR="${1:-/home/ncdeploy/nextcloud-node-red}"
|
||||
USER="${2:-ncdeploy}"
|
||||
DI="${NODERED_DIR}/.dockerignore"
|
||||
|
||||
echo "[fix] ${NODERED_DIR}"
|
||||
|
||||
chown -R "${USER}:${USER}" "${NODERED_DIR}"
|
||||
find "${NODERED_DIR}/nodes" -type d -exec chmod u+rwx,go+rx {} + 2>/dev/null || true
|
||||
find "${NODERED_DIR}/nodes" -type f -exec chmod u+rw,go+r {} + 2>/dev/null || true
|
||||
|
||||
if ! grep -q "nextcloud-collabora-nodered" "${DI}" 2>/dev/null; then
|
||||
cat >> "${DI}" <<'EOF'
|
||||
|
||||
# nextcloud-collabora-nodered
|
||||
nodes/odds-scraper/odds-scraper
|
||||
.git
|
||||
.vscode
|
||||
**/*.deb
|
||||
winboat*
|
||||
**/node_modules
|
||||
EOF
|
||||
fi
|
||||
|
||||
tar -cf /dev/null --exclude-from="${DI}" -C "${NODERED_DIR}" . \
|
||||
&& echo "[fix] Build context OK — kör ./install.sh"
|
||||
Reference in New Issue
Block a user