Update PHP test app - 2026-01-21 13:37:13
This commit is contained in:
23
php-test/Dockerfile
Normal file
23
php-test/Dockerfile
Normal file
@@ -0,0 +1,23 @@
|
||||
FROM php:8.2-apache
|
||||
|
||||
# 安装 PDO MySQL 扩展
|
||||
RUN docker-php-ext-install pdo pdo_mysql
|
||||
|
||||
# 启用 Apache mod_rewrite
|
||||
RUN a2enmod rewrite
|
||||
|
||||
# 复制项目文件到容器
|
||||
COPY . /var/www/html/
|
||||
|
||||
# 设置工作目录
|
||||
WORKDIR /var/www/html
|
||||
|
||||
# 设置文件权限
|
||||
RUN chown -R www-data:www-data /var/www/html \
|
||||
&& chmod -R 755 /var/www/html
|
||||
|
||||
# 暴露80端口
|
||||
EXPOSE 80
|
||||
|
||||
# 启动Apache
|
||||
CMD ["apache2-foreground"]
|
||||
Reference in New Issue
Block a user