n8n / run.sh
Amansoni7477030's picture
Update run.sh
da297f3 verified
raw
history blame contribute delete
891 Bytes
#!/bin/bash
# Start the PostgreSQL service
/usr/local/bin/docker-entrypoint.sh postgres &
# Check if the PostgreSQL service has started
echo "Waiting for PostgreSQL service to start..."
until pg_isready -h localhost; do
sleep 3
done
echo "PostgreSQL service has started!"
# Execute the database import script
echo "Running the database import script..."
${WORKDIR}/import-db.sh
sleep 2
# Print the container's IP address
CONTAINER_IP=$(hostname -I | awk '{print $1}')
echo "Container IP address: $CONTAINER_IP"
# Print the public IP address of the Docker host
PUBLIC_IP=$(curl -s https://api.ipify.org)
echo "Public IP address of Docker host: $PUBLIC_IP"
export N8N_ENCRYPTION_KEY="n8n8n8n"
# Allows usage of all built-in modules
export NODE_FUNCTION_ALLOW_BUILTIN=*
# Allow usage of external npm modules.
export NODE_FUNCTION_ALLOW_EXTERNAL=*
# Use absolute path to call n8n
exec n8n