From 68fc9e55e538e03f94509731ab41a0c8cf96710f Mon Sep 17 00:00:00 2001 From: George Halkiadakis Date: Mon, 17 Apr 2023 12:12:22 +0300 Subject: setup a real server environment (apache DocumentRoot=/var/www/public) --- Dockerfile | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'Dockerfile') diff --git a/Dockerfile b/Dockerfile index 6f2689d..ef8e94e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,16 +42,17 @@ RUN docker-php-ext-install pdo pdo_mysql mysqli # ------------------------------------------------------------------------------ # Copy local code to the container image. -COPY html /var/www/html +COPY public /var/www/public # Copy core files behind public COPY core /var/www/core -# Copy configuration files for the container -COPY docker /var/www/docker +# Copy storage folder structure behind public +COPY storage /var/www/storage +# Copy configuration files for the container (application based) +COPY docker /var/www/docker COPY tests /var/www/tests - COPY composer.json /var/www/ @@ -76,8 +77,14 @@ RUN locale-gen # Manage permitions in specific directories # ------------------------------------------------------------------------------ +# (make local storage directories writable) # RUN chown -R www-data:www-data /var/www -RUN chmod -R 757 /var/www/html/cache +RUN chmod -R 757 /var/www/public/cache +RUN chmod -R 757 /var/www/storage + + +# change apache's default-root to /var/www/public +RUN sed -ri -e 's!/var/www/html!/var/www/public!g' /etc/apache2/sites-available/*.conf # Use the PORT environment variable in Apache configuration files. -- cgit v1.2.3