bing / Dockerfile
dakaca's picture
Update Dockerfile
6c5522e
# 使用官方的PHP镜像作为基础镜像
FROM php:7.4-apache
# 安装MySQL客户端和PHP扩展
RUN apt-get update && apt-get install -y \
default-mysql-client \
&& docker-php-ext-install mysqli pdo_mysql
# 将Apache的默认站点配置文件替换为自定义的配置文件
COPY apache2.conf /etc/apache2/apache2.conf
COPY 000-default.conf /etc/apache2/sites-available/000-default.conf
# 复制PHP应用程序到Apache的默认站点目录
COPY index.php /var/www/html/
# 暴露Apache的默认端口
EXPOSE 7860
# 启动Apache服务器
CMD ["apache2-foreground"]