From 1737a2f5927763897cce73f0c8a4dd820fcbf7d4 Mon Sep 17 00:00:00 2001 From: Roman Date: Tue, 4 May 2021 20:56:47 +0200 Subject: [PATCH] docker permission fix --- docker-compose.yml | 4 +++- docker/nginx/Dockerfile | 4 ++++ docker/php/Dockerfile | 6 ++++-- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 docker/nginx/Dockerfile diff --git a/docker-compose.yml b/docker-compose.yml index 4e03ee2..9631897 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -2,12 +2,13 @@ version: "3.9" services: web: container_name: web - image: nginx:latest ports: - "80:80" volumes: - .:/application:rw - ./docker/nginx/site.conf:/etc/nginx/conf.d/default.conf:ro + build: + context: './docker/nginx/' links: - db - php @@ -28,4 +29,5 @@ services: context: './docker/php/' links: - db + diff --git a/docker/nginx/Dockerfile b/docker/nginx/Dockerfile new file mode 100644 index 0000000..e442aed --- /dev/null +++ b/docker/nginx/Dockerfile @@ -0,0 +1,4 @@ +FROM nginx:latest +WORKDIR "/application" +RUN mkdir -p /application/core/Configuration +RUN chown -R www-data:www-data /application diff --git a/docker/php/Dockerfile b/docker/php/Dockerfile index 18acf11..22710a9 100644 --- a/docker/php/Dockerfile +++ b/docker/php/Dockerfile @@ -1,4 +1,6 @@ FROM php:7-fpm WORKDIR "/application" - -RUN docker-php-ext-install mysqli \ No newline at end of file +RUN mkdir -p /application/core/Configuration +RUN chown -R www-data:www-data /application +RUN docker-php-ext-install mysqli +USER www-data \ No newline at end of file