Skip to content

Commit da7699f

Browse files
authored
drop host code
1 parent 74251a7 commit da7699f

File tree

1 file changed

+0
-35
lines changed

1 file changed

+0
-35
lines changed

wordpress/entrypoint-wp.sh

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ for var in \
4444
NPP_GID \
4545
NPP_NGINX_CACHE_PATH \
4646
NPP_USER \
47-
NPP_HTTP_HOST \
48-
NPP_NGINX_IP \
4947
NPP_DEV_ENABLED \
5048
MOUNT_DIR; do
5149
if [[ -z "${!var:-}" ]]; then
@@ -95,39 +93,6 @@ chown -R root:root \
9593
echo -e "${COLOR_GREEN}${COLOR_BOLD}NPP-WP:${COLOR_RESET} Permissions fixed successfully!" ||
9694
echo -e "${COLOR_RED}${COLOR_BOLD}NPP-WP:${COLOR_RESET} Failed to fix permissions!"
9795

98-
# To enable NPP - Nginx Cache Preload action:
99-
# #####################################################################
100-
# For Development Environment:
101-
# - Cause HTTP_HOST is localhost,
102-
# - Map the WordPress container's 'localhost' to Nginx's IP.
103-
# - Note: This is a tricky hack and only used for the development environment!
104-
#
105-
# For Production Environments: (Nginx sits on host or container)
106-
# - I assume you use a publicly resolvable FQDN for WordPress (WP_SITEURL & WP_HOME);
107-
# - Ensure outgoing traffic is allowed from the container.
108-
# - Verify that /etc/resolv.conf in the container is correctly configured.
109-
# - Verify that the container has internet access.
110-
# + That's all for Cache Preload works like a charm.
111-
#######################################################################
112-
if [[ "${NPP_DEV_ENABLED}" -eq 1 ]]; then
113-
IP="${NPP_NGINX_IP}"
114-
LINE="${IP} ${NPP_HTTP_HOST}"
115-
HOSTS="/etc/hosts"
116-
117-
# Hack the hosts file
118-
chmod 644 "${HOSTS}"
119-
120-
# Check if the Nginx static IP defined
121-
if ! grep -q "${IP}" "${HOSTS}"; then
122-
# Map localhost to Nginx Static IP
123-
sed -i "1i${LINE}" "${HOSTS}"
124-
echo -e "${COLOR_GREEN}${COLOR_BOLD}NPP-WP:${COLOR_RESET} Mapped '${COLOR_LIGHT_CYAN}${NPP_HTTP_HOST}${COLOR_RESET}' to Nginx static IP '${COLOR_LIGHT_CYAN}${IP}${COLOR_RESET}' in ${COLOR_LIGHT_CYAN}${HOSTS}${COLOR_RESET}."
125-
else
126-
echo -e "${COLOR_YELLOW}${COLOR_BOLD}NPP-WP:${COLOR_RESET} Mapping already exists: '${COLOR_LIGHT_CYAN}${NPP_HTTP_HOST}${COLOR_RESET}' -> '${COLOR_LIGHT_CYAN}${IP}${COLOR_RESET}'."
127-
fi
128-
fi
129-
#######################################################################
130-
13196
# Wait for the 'wordpress-db' to be ready
13297
until mysql -h wordpress-db -u"${WORDPRESS_DB_USER}" -p"${WORDPRESS_DB_PASSWORD}" "${WORDPRESS_DB_NAME}" -e "SELECT 1" > /dev/null 2>&1; do
13398
echo -e "${COLOR_YELLOW}${COLOR_BOLD}NPP-WP:${COLOR_RESET} The ${COLOR_LIGHT_CYAN}MySQL database${COLOR_RESET} is not available yet. Retrying..."

0 commit comments

Comments
 (0)