overlay-fs bug workaround - move to tmp location then move and chown on init

This commit is contained in:
Alex Phillips 2021-09-09 17:47:38 -04:00
parent 8361cd993e
commit 63a61cf818
4 changed files with 15 additions and 6 deletions

View File

@ -53,6 +53,8 @@ RUN \
/var/www/html/ --strip-components=1 && \
echo "**** install composer dependencies ****" && \
composer install -d /var/www/html/ && \
echo "**** overlay-fs bug workaround ****" && \
mv /var/www /var/www-tmp && \
echo "**** cleanup ****" && \
rm -rf \
/root/.composer \
@ -61,4 +63,4 @@ RUN \
COPY root/ /
VOLUME /config
EXPOSE 80
EXPOSE 80

View File

@ -53,6 +53,8 @@ RUN \
/var/www/html/ --strip-components=1 && \
echo "**** install composer dependencies ****" && \
composer install -d /var/www/html/ && \
echo "**** overlay-fs bug workaround ****" && \
mv /var/www /var/www-tmp && \
echo "**** cleanup ****" && \
rm -rf \
/root/.composer \
@ -61,4 +63,4 @@ RUN \
COPY root/ /
VOLUME /config
EXPOSE 80
EXPOSE 80

View File

@ -53,6 +53,8 @@ RUN \
/var/www/html/ --strip-components=1 && \
echo "**** install composer dependencies ****" && \
composer install -d /var/www/html/ && \
echo "**** overlay-fs bug workaround ****" && \
mv /var/www /var/www-tmp && \
echo "**** cleanup ****" && \
rm -rf \
/root/.composer \
@ -61,4 +63,4 @@ RUN \
COPY root/ /
VOLUME /config
EXPOSE 80
EXPOSE 80

View File

@ -1,5 +1,11 @@
#!/usr/bin/with-contenv bash
if [ -d /var/www-tmp ]; then
echo "New container detected. Setting up app folder and fixing permissions."
mv /var/www-tmp /var/www
chown -R abc:abc /var/www
fi
# create directory structure
mkdir -p \
/config/www/{uploads,files,images}
@ -108,8 +114,5 @@ fi
chown -R abc:abc \
/config
find /var/www -print0 | xargs -P "$(nproc)" -I {} -0 chown -h abc:abc {}
find /var/www -print0 -type d | xargs -P "$(nproc)" -I {} -0 chown -h abc:abc {}
# set lockfile to avoid DB waits for this specific container
touch /dbwait.lock