This commit is contained in:
boris committed 2026-04-02 15:42:38 +01:00
1 parent 72a99a5bcd
commit 75756ac6ec
10 files changed
+1144 -32

No files matched your search

+10 -2
View File
@@ -103,7 +103,11 @@ COPY composer.json composer.lock* symfony.lock* ./
# Install vendors (cached)
RUN --mount=type=cache,target=/tmp/composer \
if [ -f composer.json ]; then \
composer install --no-dev --prefer-dist --no-interaction --no-progress --no-scripts; \
if [ "$APP_ENV" = "dev" ] || [ "$APP_ENV" = "test" ]; then \
composer install --prefer-dist --no-interaction --no-progress --no-scripts; \
else \
composer install --no-dev --prefer-dist --no-interaction --no-progress --no-scripts; \
fi; \
fi
# Copy the rest of the app
@@ -112,7 +116,11 @@ COPY . /var/www/html
# Finalize install & warm cache
RUN if [ -f bin/console ]; then \
set -ex; \
composer dump-autoload --no-dev --optimize; \
if [ "$APP_ENV" = "dev" ] || [ "$APP_ENV" = "test" ]; then \
composer dump-autoload --optimize; \
else \
composer dump-autoload --no-dev --optimize; \
fi; \
mkdir -p var var/data public/uploads; \
chown -R www-data:www-data var public/uploads; \
fi
+9 -6
View File
@@ -2,7 +2,8 @@
set -eu
prepare_runtime_dirs() {
mkdir -p var/cache/prod/asset_mapper var/log var/data public/uploads
cache_dir="var/cache/${APP_ENV:-prod}/asset_mapper"
mkdir -p "${cache_dir}" var/log var/data public/uploads
chown -R www-data:www-data var public/uploads
chmod -R u+rwX,g+rwX var public/uploads
@@ -57,11 +58,13 @@ install_runtime() {
fi
echo "Installing Composer dependencies..."
su-exec www-data composer install \
--no-dev \
--prefer-dist \
--no-interaction \
--no-progress
composer_flags="--prefer-dist --no-interaction --no-progress"
if [ "${APP_ENV:-prod}" = "prod" ]; then
composer_flags="${composer_flags} --no-dev"
fi
# shellcheck disable=SC2086
su-exec www-data composer install ${composer_flags}
}
install_runtime