浏览代码

add servername and grant apache permissions

ksieren 2 年之前
父节点
当前提交
fc1753a161
共有 1 个文件被更改,包括 7 次插入0 次删除
  1. 7 0
      Dockerfile

+ 7 - 0
Dockerfile

@@ -37,6 +37,13 @@ RUN a2enmod proxy_fcgi setenvif rewrite
 RUN sed -i 's|DocumentRoot /var/www/html|DocumentRoot /var/www/html/public|g' /etc/apache2/sites-available/000-default.conf \
     && sed -i 's|<Directory /var/www/html>|<Directory /var/www/html/public>|g' /etc/apache2/sites-available/000-default.conf
 
+# Set ServerName directive
+RUN echo "ServerName localhost" >> /etc/apache2/apache2.conf
+
+# Grant Apache permission to bind to ports 80 and 443
+RUN apt-get install -y libcap2-bin \
+    && setcap 'cap_net_bind_service=+ep' /usr/sbin/apache2
+
 # Install Composer
 RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer