Skip to content

Commit

Permalink
Use cp instead of mv for config files
Browse files Browse the repository at this point in the history
When config files are inside a docker volume used as the document root
it will cause any config files that move-config-files.sh moves to
effectively disappear from the docker volume which is unintended
behaviour.

Fixes GoogleCloudPlatform#419
  • Loading branch information
Daniel Holmes (jaitaiwan) committed Feb 14, 2018
1 parent 585f146 commit 62eec4e
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions php-base/build-scripts/move-config-files.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,15 @@ fi

# Move user-provided nginx config files.
if [ -f "${NGINX_CONF_INCLUDE}" ]; then
mv "${NGINX_CONF_INCLUDE}" "${NGINX_USER_CONF_DIR}/nginx-app.conf"
cp "${NGINX_CONF_INCLUDE}" "${NGINX_USER_CONF_DIR}/nginx-app.conf"
fi

if [ -f "${NGINX_CONF_HTTP_INCLUDE}" ]; then
mv "${NGINX_CONF_HTTP_INCLUDE}" "${NGINX_USER_CONF_DIR}/nginx-http.conf"
cp "${NGINX_CONF_HTTP_INCLUDE}" "${NGINX_USER_CONF_DIR}/nginx-http.conf"
fi

if [ -f "${NGINX_CONF_OVERRIDE}" ]; then
mv "${NGINX_CONF_OVERRIDE}" "${NGINX_DIR}/nginx.conf"
cp "${NGINX_CONF_OVERRIDE}" "${NGINX_DIR}/nginx.conf"
fi

# User provided php-fpm.conf
Expand All @@ -67,7 +67,7 @@ fi

# Move user-provided php-fpm config file.
if [ -f "${PHP_FPM_CONF_OVERRIDE}" ]; then
mv "${PHP_FPM_CONF_OVERRIDE}" "${PHP_DIR}/etc/php-fpm-user.conf"
cp "${PHP_FPM_CONF_OVERRIDE}" "${PHP_DIR}/etc/php-fpm-user.conf"
fi

# User provided php.ini
Expand All @@ -79,7 +79,7 @@ fi

# Move user-provided php.ini.
if [ -f "${PHP_INI_OVERRIDE}" ]; then
mv "${PHP_INI_OVERRIDE}" "${PHP_DIR}/lib/conf.d"
cp "${PHP_INI_OVERRIDE}" "${PHP_DIR}/lib/conf.d"
fi

# User provided supervisord.conf
Expand All @@ -97,9 +97,9 @@ fi

# Move user-provided supervisord.conf.
if [ -f "${SUPERVISORD_CONF_ADDITION}" ]; then
mv "${SUPERVISORD_CONF_ADDITION}" /etc/supervisor/conf.d
cp "${SUPERVISORD_CONF_ADDITION}" /etc/supervisor/conf.d
fi

if [ -f "${SUPERVISORD_CONF_OVERRIDE}" ]; then
mv "${SUPERVISORD_CONF_OVERRIDE}" /etc/supervisor/supervisord.conf
cp "${SUPERVISORD_CONF_OVERRIDE}" /etc/supervisor/supervisord.conf
fi

0 comments on commit 62eec4e

Please sign in to comment.