From 21ea518d78c8972ee3e8447d8c142161918cb7b1 Mon Sep 17 00:00:00 2001 From: Ramon Robben Date: Mon, 7 Jun 2021 20:32:48 +0200 Subject: [PATCH] Fixed docker permissions --- docker/docker-compose.yml | 4 ++-- docker/nginx/Dockerfile | 4 ++-- docker/php/Dockerfile | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml index fbcfa330..c0d56057 100644 --- a/docker/docker-compose.yml +++ b/docker/docker-compose.yml @@ -12,7 +12,7 @@ services: ports: - 80:80 volumes: - - ../:/var/www/html:delegated + - "../:/var/www/html:delegated" depends_on: - php - mysql @@ -42,7 +42,7 @@ services: dockerfile: docker/php/Dockerfile container_name: controlpanel_php volumes: - - ../:/var/www/html:delegated + - "../:/var/www/html:delegated" networks: - laravel diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile index 606fe311..51bf97ea 100644 --- a/docker/nginx/Dockerfile +++ b/docker/nginx/Dockerfile @@ -1,10 +1,10 @@ FROM nginx:stable-alpine +RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel + ADD ./docker/nginx/nginx.conf /etc/nginx/ ADD ./docker/nginx/default.conf /etc/nginx/conf.d/ RUN mkdir -p /var/www/html -RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel - RUN chown laravel:laravel /var/www/html diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 81400ac7..65dfab87 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -6,16 +6,16 @@ RUN apk add --no-cache --repository https://alpine.global.ssl.fastly.net/alpine/ RUN apk add --no-cache curl-dev icu-dev libzip-dev RUN docker-php-ext-install mysqli pdo pdo_mysql intl zip -COPY --from=composer:latest /usr/bin/composer /usr/bin/composer - ADD ./docker/php/www.conf /usr/local/etc/php-fpm.d/ -RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel - RUN mkdir -p /var/www/html +RUN addgroup -g 1000 laravel && adduser -G laravel -g laravel -s /bin/sh -D laravel RUN chown laravel:laravel /var/www/html WORKDIR /var/www/html -RUN docker-php-ext-install pdo pdo_mysql +USER laravel + +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer +