From 253fd1b68817b7a7cdfe2d9b2d4ec2c4011d717b Mon Sep 17 00:00:00 2001 From: William Hall Date: Fri, 1 Dec 2023 11:58:33 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20run=20tests=20as=20not=20root?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c3404d8..52b0b6a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,14 +13,20 @@ RUN curl -sS https://getcomposer.org/installer | php \ WORKDIR /package -COPY composer.json ./ +RUN adduser -D -g '' dev + +RUN chown dev -R /package + +USER dev + +COPY --chown=dev composer.json ./ ARG LARAVEL=8 RUN composer require illuminate/support ^$LARAVEL.0 -COPY src src -COPY config config -COPY tests tests -COPY phpunit.xml ./ +COPY --chown=dev src src +COPY --chown=dev config config +COPY --chown=dev tests tests +COPY --chown=dev phpunit.xml ./ RUN composer test