From f4ce626f4c5cd61315ce455364f4e04b4d52ea1e Mon Sep 17 00:00:00 2001 From: casjay Date: Thu, 6 Oct 2022 11:25:40 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Committing=20everything?= =?UTF-8?q?=20that=20changed=20=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 6 +++--- bin/entrypoint-wordpress.sh | 11 ++++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index b449991..365291c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,10 +5,10 @@ ARG BUILD_DATE \ PORT=80 ENV TERM="xterm" \ - DB_HOST="localhost" \ + DB_HOST="localhost" \ DB_NAME="wordpress" \ - DB_USER="root"\ - DB_PASS="password" + DB_USER="root" \ + DB_PASS="password" RUN apk -U upgrade && \ apk add --no-cache bash curl less vim nginx ca-certificates git tzdata zip \ diff --git a/bin/entrypoint-wordpress.sh b/bin/entrypoint-wordpress.sh index 6fd401a..1cae947 100644 --- a/bin/entrypoint-wordpress.sh +++ b/bin/entrypoint-wordpress.sh @@ -1,4 +1,10 @@ -#!/bin/bash +#!/usr/bin/env bash + +DB_HOST="${DB_HOST:-localhost}" +DB_NAME="${DB_NAME:-wordpress}" +DB_USER="${DB_USER:-root}" +DB_PASS="${DB_PASS:-password}" + __url_check() { curl -q -SIs "http://localhost:80" | grep -qE 'HTTP/[1,2]*' && return 0 || return 1 @@ -43,8 +49,7 @@ if [ "$1" = "healthcheck" ]; then __url_check && __file_check && exit 0 || exit 1 fi -if [ ! -d "/usr/html/wp-admin" ] && [ ! -f "/usr/html/wp-config.php" ]; then - echo "[i] Installing wordpress..." +if [ ! -d "/usr/html/wp-admin" ] && [ ! -f "/usr/html/wp-config.php" ]; then echo "[i] Installing wordpress..." cd /tmp || exit 1 wget https://wordpress.org/latest.tar.gz -O /tmp/latest.tar.gz && tar -xzf /tmp/latest.tar.gz &&