Fixes in plane

This commit is contained in:
Oliver
2025-08-11 05:16:34 -03:00
parent a84fe3f740
commit eb172a367f
22 changed files with 219 additions and 174 deletions

54
app/sbin/startContainer Executable file → Normal file
View File

@@ -1,52 +1,14 @@
#!/usr/bin/env bash
exec > /4server/data/startContainer.log 2>&1
this script gets a container UUID
echo "$(date '+%Y-%m-%d %H:%M') - startContainer $1"
Wtrite a bash script, that gets all info out off the Sqlite3 Database usind the UUID and stores the values in environment variables
setr the BIN_BATH to /4srver/sbin/
CONTAINER_NAME="$1"
the uuid looks like xxx-xxx-xxxx-xxxx-xxxx-....
# Get the hostname of the machine
HOSTNAME=$(hostname)
get the second number
mkdir -p /4server/data/${CONTAINER_NAME}/n8n
mkdir -p /4server/data/${CONTAINER_NAME}/data
When the number is 001 call the script BIN_PATH/start/n8n
When the number is 002 call the sctipr BIN_ÜATH/start/ODOO18
WHen the number is 003 call the script BIN_PATH/start/ODOO19
sudo chmod 777 /4server/data/${CONTAINER_NAME}/n8n
sudo chmod 777 /4server/data/${CONTAINER_NAME}/data
# Stop the container if it exists
if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then
echo "$(date '+%Y-%m-%d %H:%M') - stopping existing container $CONTAINER_NAME"
docker stop "$CONTAINER_NAME"
docker rm "$CONTAINER_NAME"
fi
docker run -d \
--name "$CONTAINER_NAME" \
-p 5678 \
--cap-add=SYS_ADMIN \
--security-opt seccomp=unconfined \
--restart=always \
-e N8N_HOST="${CONTAINER_NAME}.od8n.com" \
-e N8N_PORT=5678 \
-e N8N_PROTOCOL=https \
-e NODE_ENV=production \
-e WEBHOOK_URL="https://${CONTAINER_NAME}.od8n.com/" \
-e GENERIC_TIMEZONE="UTC-3" \
-v "/4server/data/${CONTAINER_NAME}/n8n:/home/node/.n8n" \
-v "/4server/data/${CONTAINER_NAME}/data:/data" \
--label "traefik.enable=true" \
--label "traefik.http.routers.${CONTAINER_NAME}.rule=Host(\`${CONTAINER_NAME}.od8n.com\`)" \
--label "traefik.http.routers.${CONTAINER_NAME}.entrypoints=web,websecure" \
--label "traefik.http.routers.${CONTAINER_NAME}.tls=true" \
--label "traefik.http.routers.${CONTAINER_NAME}.tls.certresolver=production" \
--label "traefik.http.services.${CONTAINER_NAME}.loadbalancer.server.port=5678" \
--network docker-compose_4projects \
n8nio/n8n:latest
echo "Done $1"