Hello.
I have this docker-compose.yml:
version: '2'
services:
php:
build: .
volumes:
- ./web/uploads:/app/web/uploads:delegated
ports:
- '8000:80'
And Dockerfile:
FROM yiisoftware/yii2-php:8.1-apache
COPY ./base.ini /usr/local/etc/php/conf.d/base.ini
COPY . /app
WORKDIR /app
RUN composer install
RUN chown -R www-data:www-data /app
RUN chmod o+w /app/web/uploads && chmod o+w /app/web/uploads/result
After I cloned this repository from github a folder ‘uploads’ will have my ubuntu owner and group and rights - rwxrwxr-x. Inside container it will have 1000:1000 ownership.
Inside container we have apache user - www-data - who cannot write to the directory ‘uploads’. Somehow the last line in Dockerfile has no effect.
I would like to lanch application with one command - docker compose up -d, after I got app’s files.
Any suggestions how to do it? Thanks.