I am trying to create a Docker image to load a Symfony project. Here is my Docker file:
FROM php:7-apache
LABEL Description = "This image is used to start Symfony3 project"
ENV DIRPATH /var/www/html
RUN apt-get update && apt-get install -y \
vim \
git
RUN apt-get install -y zlib1g-dev && docker-php-ext-install zip
RUN curl -sS https://getcomposer.org/installer | php
RUN mv composer.phar /usr/local/bin/composer
RUN curl -LsS http://symfony.com/installer -o /usr/local/bin/symfony
RUN chmod a+x /usr/local/bin/symfony
RUN cp /usr/src/php/php.ini-development /usr/local/etc/php/php.ini
Building an assembly and creating a container work well, but I have a resolution problem in my container. When I go to app_dev.php , I have this message:
You are not allowed access to this file. Check app_dev.php for more information.
Apparently, I can only access this file using localhost. Also, PHP cannot delete or create anything in my container. For example, I have the following error at startup:
$php app/console cache:clear
Failed to remove directory "/var/www/html/app/cache/dev_old/doctrine
How can I solve this in my Docker file?
Kevin