Попытка установить проект laravel с помощью redis, mysql и mongodb. Использование docker -compose для установки docker контейнеров, но 127.0.0.1 выдает The stream or file "/var/www/html/storage/logs/laravel.log" could not be opened: failed to open stream: Permission denied
. Каталог Chown'ing, но владелец / var / www/html внутри контейнера 'app' root, а не www-data. Как это исправить?
Dockerfile
ARG PHP_VERSION
FROM php:7-fpm-alpine
ARG APP_ENV
ARG REMOTE_WORKING_DIR
RUN apk update && apk add --no-cache $PHPIZE_DEPS \
build-base shadow nano curl gcc git bash \
php7 \
...installing dependencies...
...redis & mongodb...
...php settings...
...installing composer...
RUN rm -rf /var/cache/apk/*
RUN apk add shadow && usermod -u 1000 www-data && groupmod -g 1000 www-data
COPY . $REMOTE_WORKING_DIR
RUN sudo chown -R www-data:www-data $REMOTE_WORKING_DIR
USER www-data
EXPOSE 9000
CMD ["php-fpm"]
docker -compose.yml
version: "3"
services:
app:
build:
context: ./docker/php
args:
APP_ENV: ${APP_ENV}
PHP_VERSION: ${PHP_VERSION}
REMOTE_WORKING_DIR: ${REMOTE_WORKING_DIR}
container_name: app
restart: always
env_file: .env
ports:
...
links:
- redis
networks:
...
volumes:
- ${LOCAL_WORKING_DIR}:${REMOTE_WORKING_DIR}
- ./docker/php/config/xdebug.ini:/usr/local/etc/php/conf.d/xdebug.ini
nginx:
...
volumes:
- ${LOCAL_WORKING_DIR}:${REMOTE_WORKING_DIR}
- ./docker/nginx/nginx.conf:/etc/nginx/nginx.conf
- ./docker/nginx/conf.d/:/etc/nginx/conf.d/
- ./docker/nginx/ssl/:/etc/nginx/ssl/
ports:
...
depends_on:
- app
networks:
...
redis:
...
networks:
...