diff --git a/.dockerignore b/.dockerignore index 238da74..9565dc7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -8,6 +8,9 @@ !composer* !index.php +!cmd.sh +!init_content.sh + # Allow example files and directories !cache/ !content/ diff --git a/Dockerfile b/Dockerfile index bb8ad86..9e8f52c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,6 +40,15 @@ RUN chmod +x /usr/local/bin/install-composer && \ # chmod +x /usr/local/bin/adjust-rights && \ # /usr/local/bin/adjust-rights +RUN chown -R www-data:www-data /var/www/html \ + && find /var/www/html -type d -exec chmod 570 {} \; \ + && find /var/www/html -type f -exec chmod 460 {} \; +RUN cp -R /var/www/html/content /var/www/html/content.orig +COPY cmd.sh / +COPY init_content.sh / +RUN chown root:root /cmd.sh ; chmod 0700 /cmd.sh +RUN chown root:root /init_content.sh ; chmod 0700 /init_content.sh +CMD ["/cmd.sh"] # Create a non-root user to own the files and run our server #WORKDIR /var/www/html @@ -73,4 +82,4 @@ RUN chmod +x /usr/local/bin/install-composer && \ #USER www-data # Run the server -CMD ["/usr/local/bin/init-server"] \ No newline at end of file +#CMD ["/usr/local/bin/init-server"] \ No newline at end of file diff --git a/docker-utils/init-server b/docker-utils/init-server index 91245b0..8356607 100644 --- a/docker-utils/init-server +++ b/docker-utils/init-server @@ -4,7 +4,7 @@ #groupmod -g $PGID www-data #find /var/www/html -type d -empty -exec cp -R /tmp/* /var/www/html/ \; # -#cp -R /src/* /var/www/html/ +cp -R /src/* /var/www/html/ #cp -R /tmp/* /var/www/html/ #/usr/local/bin/install-composer && \