change: www volume managed better

This commit is contained in:
mcolonna 2025-06-13 12:26:40 +02:00
parent 49a136c709
commit f5c5b31fbd
7 changed files with 43 additions and 38 deletions

View file

@ -26,11 +26,6 @@ services:
volumes:
www:
driver: local
driver_opts:
o: bind
type: none
device: "${INCEPTION_WWW_PATH:?error}"
db:
### services ###

View file

@ -19,6 +19,8 @@ RUN adduser -D -S -G www www
# add config
COPY /conf/ /etc/php83/
COPY /conf/wwwmore/ /conf/wwwmore/
COPY /run.sh /run.sh
# start
CMD ["php-fpm83", "-F"]
CMD ["/run.sh"]

View file

@ -0,0 +1,34 @@
#!/bin/sh
set -e
echo
dirisempty()
{
[ -z "$( ls -A "$1" )" ]
}
if dirisempty /www
then
echo "download and uncompress wordpress release..."
echo
apk add curl
apk fix
rm -rf /build
mkdir -p "/build/www/"
curl https://wordpress.org/latest.tar.gz | tar zx -C /build/www
chmod -R 777 /www
mv $(find /build/www/wordpress -maxdepth 1 -mindepth 1) /www
rm -rf /build
echo
echo "add files from /conf/wwwmore/"
echo
cp -r /conf/wwwmore/. /www
echo "www directory created!"
echo
fi
echo "to recreate the www directory, remove the www volume of this compose."
echo
php-fpm83 -F