Skip to content

Commit

Permalink
add Docker repo
Browse files Browse the repository at this point in the history
  • Loading branch information
airplayx committed Nov 2, 2023
1 parent 50b5d2a commit 95bcf3f
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,27 @@
FROM php:7.1-apache

ENV HOME /var/www/html
ENV TZ Asia/Shanghai
WORKDIR /var/www/html
ENV APACHE_DOCUMENT_ROOT $HOME

COPY . .
RUN apt-get update && \
apt-get install -y \
libzip-dev \
libonig-dev \
&& docker-php-ext-install pdo pdo_mysql zip pcntl fileinfo
RUN ln -snf /usr/share/zoneinfo/${TZ} /etc/localtime && echo ${TZ} > /etc/timezone \
&& sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf \
&& sed -ri -e 's!/var/www/html/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf \
&& apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
&& docker-php-ext-install pdo pdo_mysql zip pcntl fileinfo \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& apt-get clean \
&& apt-get autoclean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN chmod -R 777 /var/www/html
COPY . $HOME

EXPOSE 80
RUN a2enmod rewrite \
&& chmod -R 0755 $HOME \
&& chown -R www-data:www-data $HOME

EXPOSE 80

0 comments on commit 95bcf3f

Please sign in to comment.