Browse Source

docker permission fix

Roman 3 years ago
parent
commit
1737a2f592
3 changed files with 11 additions and 3 deletions
  1. 3 1
      docker-compose.yml
  2. 4 0
      docker/nginx/Dockerfile
  3. 4 2
      docker/php/Dockerfile

+ 3 - 1
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
+    
 

+ 4 - 0
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

+ 4 - 2
docker/php/Dockerfile

@@ -1,4 +1,6 @@
 FROM php:7-fpm
 WORKDIR "/application"
-
-RUN docker-php-ext-install mysqli
+RUN mkdir -p /application/core/Configuration
+RUN chown -R www-data:www-data /application
+RUN docker-php-ext-install mysqli
+USER www-data