写一个dockerfile,环境是php7.3,包括mysql5.7
时间: 2023-04-03 14:02:39 浏览: 138
php7.3的dockerfile
FROM php:7.3-apache
RUN apt-get update && apt-get install -y \
libfreetype6-dev \
libjpeg62-turbo-dev \
libpng-dev \
libzip-dev \
unzip \
&& docker-php-ext-install -j$(nproc) iconv mysqli pdo_mysql zip \
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
&& docker-php-ext-install -j$(nproc) gd \
&& a2enmod rewrite
COPY . /var/www/html/
RUN chown -R www-data:www-data /var/www/html/
EXPOSE 80
CMD ["apache2-foreground"]
# Dockerfile for MySQL 5.7
FROM mysql:5.7
COPY ./my.cnf /etc/mysql/conf.d/my.cnf
EXPOSE 3306
CMD ["mysqld"]
阅读全文