phormer / Dockerfile
jokyo3's picture
Update Dockerfile
696056b verified
raw
history blame contribute delete
615 Bytes
# 使用官方 PHP 镜像,带有 Apache 服务器
FROM php:7.4-apache
# 复制站点代码到容器中的 Apache 服务器目录
COPY . /var/www/html
# 更新包列表并安装unzip工具
RUN apt-get update && apt-get install -y unzip
# 设置工作目录
WORKDIR /var/www/html
# 在当前目录解压xxx.zip文件
RUN unzip phormer335.zip
RUN ls -l
# 暴露 7860 端口
EXPOSE 7860
# 修改 Apache 配置文件以监听 7860 端口
RUN sed -i 's/80/7860/' /etc/apache2/ports.conf
RUN sed -i 's/:80/:7860/' /etc/apache2/sites-available/000-default.conf
# 启动 Apache 服务器
CMD ["apache2-foreground"]