File size: 584 Bytes
6c5522e
 
339d677
6c5522e
 
 
 
1373aee
6c5522e
 
 
b7a051c
6c5522e
 
b7a051c
6c5522e
 
339d677
6c5522e
 
b7a051c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# 使用官方的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"]