0
I set up a portable project, created a Docker-Compose below:
# v3 syntax
version: 3
services:
# PHP (apache)
blog:
image: php:7.1-apache
container_name: blog-apache
ports:
- "8000:80"
volumes:
- .:/var/www/blog
- ./apache/000-default.conf:/etc/apache2/sites-enabled/000-default.conf
command: "chown www-data:www-data /var/www/blog/storage:
But when I run Docker-Compose up -d in the terminal the Exit container, only with the line "command:", when I take that line the container goes up normal.
I need that command line to change permissions in the Storage folder. How can I do ?
Thank you for the answer ! but it didn’t work, in the container log it was returned after I added: chown: cannot access '&&': No such file or directory chown: cannot access 'apache2-foreground': No such file or directory
– Danilo Tiago Thai Santos
Do you have any idea how I can fix ?
– Danilo Tiago Thai Santos
he should be there, you can try to add the absolute path (
/usr/local/bin/apache2-foreground
), or replace the&&
by a simple;
, so it starts even if thechown
fail ...– thiagoalessio
Now he found the path to apache2-foreground, but it didn’t work "&&" nor ";" => chown: cannot access '&&': No such file or directory and => chown: cannot access ';': No such file or directory unfortunately :(
– Danilo Tiago Thai Santos
command: /bin/sh -c 'chown www-data. /var/blog/storage ; apache2-foreground'
– thiagoalessio
It worked! Thank you !!!
– Danilo Tiago Thai Santos