Speed Up Build
This commit is contained in:
1 parent
411f7be896
commit
3883abbc85
6 files changed
+50
-2
No files matched your search
+6
-1
@@ -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 && \
|
||||
|
||||
@@ -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
|
||||
@@ -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
|
||||
Reference in new issue
Block a user