Merge pull request #107 from fleetbase/fix-docker-build-without-auth

fix application build without composer auth
This commit is contained in:
Ron
2023-08-10 15:58:35 +08:00
committed by GitHub
2 changed files with 7 additions and 3 deletions

Submodule console updated: 812c41adea...30b99faba1

View File

@@ -59,8 +59,12 @@ RUN chmod -R 755 ./storage
# Load the secret into the auth.json file if exists, and install dependencies
COPY composer-auth.jso[n] /root/.composer/auth.json
RUN --mount=type=secret,id=composer_auth,target=/root/.composer/auth.json \
cp /root/.composer/auth.json /var/www/.composer/auth.json 2>/dev/null && \
chown www-data:www-data /var/www/.composer/auth.json && \
if [ -f "/root/.composer/auth.json" ]; then \
mkdir -p /var/www/.composer/ && \
cp /root/.composer/auth.json /var/www/.composer/auth.json && \
chown www-data:www-data /var/www/.composer/auth.json && \
su www-data -s /bin/sh -c "composer install && composer dumpautoload"; \
fi; \
su www-data -s /bin/sh -c "composer install && composer dumpautoload"
# Continue