Rework #1

Open
JonatanRek wants to merge 31 commits from rework into dev
pull from: rework
6 changed files with 50 additions and 2 deletions
Showing only changes of commit 3883abbc85 - Show all commits

No files matched your search

+6 -1
View File
@@ -116,6 +116,11 @@ COPY ./supervisor.d/ /etc/supervisor/conf.d/
#ENTRYPOINTS
COPY --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/
COPY --chmod=755 ./entrypoint-runner.sh /usr/local/bin/entrypoint-runner.sh
# Persistent .env storage (see entrypoint.d/20-env.sh)
RUN mkdir -p /config
VOLUME /config
# Install composer # bun
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
@@ -124,7 +129,7 @@ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local
RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf && \
sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf && \
sed -i 's/^exec /printenv > \/etc\/environment\n\nexec /' /usr/local/bin/apache2-foreground && \
sed -i 's#^exec #for f in /etc/entrypoint.d/*.sh; do if [ -x "$f" ]; then "$f" || { echo "entrypoint script failed: $f" >\&2; exit 1; }; fi; done\n\nexec #' /usr/local/bin/apache2-foreground
sed -i 's#^exec #entrypoint-runner.sh\n\nexec #' /usr/local/bin/apache2-foreground
#Cleaning
RUN apt-get clean && \
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# Legacy images ship their own start.sh in the app root and do the whole setup themselves.
[ -f "${APP_ROOT:-/var/www/html}/start.sh" ] && exit 0
for f in /etc/entrypoint.d/*.sh; do
if [ -x "$f" ]; then
"$f" || { echo "entrypoint script failed: $f" >&2; exit 1; }
fi
done
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
# Mounted volumes are usually root-owned, so www-data could not write into storage and bootstrap/cache.
cd "${APP_ROOT:-/var/www/html}" || exit 0
for dir in storage bootstrap/cache; do
if [ -d "$dir" ] && [ "$(stat -c %U "$dir")" != "www-data" ]; then
chown -R www-data:www-data "$dir"
fi
done
exit 0
+6 -1
View File
@@ -111,6 +111,11 @@ COPY ./supervisor.d/ /etc/supervisor/conf.d/
# Entrypoint scripts (run in order from the stock entrypoint)
COPY --chmod=755 ./entrypoint.d/ /etc/entrypoint.d/
RUN sed -i 's#^exec #for f in /etc/entrypoint.d/*.sh; do if [ -x "$f" ]; then "$f" || { echo "entrypoint script failed: $f" >\&2; exit 1; }; fi; done\n\nexec #' /usr/local/bin/docker-php-entrypoint
COPY --chmod=755 ./entrypoint-runner.sh /usr/local/bin/entrypoint-runner.sh
# Persistent .env storage (see entrypoint.d/20-env.sh)
RUN mkdir -p /config
VOLUME /config
RUN sed -i 's#^exec #entrypoint-runner.sh\n\nexec #' /usr/local/bin/docker-php-entrypoint
WORKDIR ${APP_ROOT}
+9
View File
@@ -0,0 +1,9 @@
#!/bin/sh
# Legacy images ship their own start.sh in the app root and do the whole setup themselves.
[ -f "${APP_ROOT:-/var/www/html}/start.sh" ] && exit 0
for f in /etc/entrypoint.d/*.sh; do
if [ -x "$f" ]; then
"$f" || { echo "entrypoint script failed: $f" >&2; exit 1; }
fi
done
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
# Mounted volumes are usually root-owned, so www-data could not write into storage and bootstrap/cache.
cd "${APP_ROOT:-/var/www/html}" || exit 0
for dir in storage bootstrap/cache; do
if [ -d "$dir" ] && [ "$(stat -c %U "$dir")" != "www-data" ]; then
chown -R www-data:www-data "$dir"
fi
done
exit 0