Add Docker Build file

pull/89/head
AkarinLiu 2024-03-24 12:51:04 +08:00
parent 30bc7b40ce
commit 9dd053cbd8
2 changed files with 15 additions and 0 deletions

3
.dockerignore Normal file
View File

@ -0,0 +1,3 @@
.gitignore
.gitattributes
.editorconfig

12
Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM debian
WORKDIR /var/www/html
VOLUME [ "/var/www/html" ]
RUN apt-get update && apt-get install -y apache2 php-common php-mysql php-mbstring php-xml php-curl php-exif php-gd php-intl php-soap php-zip composer
RUN a2enmod rewrite
RUN sed -i 's#^DocumentRoot ".*#DocumentRoot "/var/www/html/public"#' /etc/apache2/sites-enabled/000-default.conf
COPY . /var/www/html
RUN composer install --no-dev --optimize-autoloader
RUN chown -R www-data:www-data /var/www/html
RUN chmod 755 /var/www/html/
EXPOSE 80
CMD ["apache2ctl", "-D", "FOREGROUND"]