diff --git a/Dockerfile b/Dockerfile index 55664d4..14da30d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -207,4 +207,4 @@ EXPOSE 2222/tcp ENTRYPOINT ["/usr/local/docker-entrypoint.sh"] # Start PHP-FPM and Nginx servers -CMD /usr/local/php-fpm.sh & nginx -g "daemon off;" -c "/var/www/nginx.conf" & /usr/sbin/sshd -D +CMD /usr/local/php-fpm.sh & nginx -g "daemon off;" -c "/var/www/html/nginx.conf" & /usr/sbin/sshd -D diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index cbedcdb..79d4d2b 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -34,12 +34,12 @@ fi #copy nginx config file_path="/etc/nginx/nginx.conf" -dst_path="/var/www/nginx.conf" +dst_path="/var/www/html/nginx.conf" if [ -f "$dst_path" ]; then echo "$dst_path already exist." else echo "Creating $dst_path..." - cp "$file_path" "/var/www/" + cp "$file_path" "/var/www/html/" echo "Nginx file copied successfully." fi @@ -57,7 +57,7 @@ for contentPath in \ sourceTarArgs+=( --exclude "./$contentPath" ) fi done -if [ -d "/var/www/html/wp-admin" ]; then +if [ -d "/var/www/html/wp-admin" ] && [ -f "/var/www/html/wp-config.php" ]; then echo "Wordpress already there skipping..." else tar "${sourceTarArgs[@]}" . | tar "${targetTarArgs[@]}" diff --git a/nginx.conf b/nginx.conf index f608d38..27b3954 100644 --- a/nginx.conf +++ b/nginx.conf @@ -69,6 +69,10 @@ http { location = /xmlrpc.php { deny all; } + # Block nginx.conf + location = /nginx.conf { + deny all; + } }