Speed Up Build
This commit is contained in:
1 parent
411f7be896
commit
3883abbc85
6 files changed
+50
-2
No files matched your search
@@ -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}
|
||||
@@ -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