这个是docker 配置的base dockerfile 如果搭建php+nginx 环境,可以直接使用这个dockerfile配置。直接在你代码里面的dockerfile 引用此基础镜像。
# 使用官方的 PHP 镜像作为基础镜像
FROM php:8.1-fpm
# 更换国内源并安装系统依赖
RUN rm -rf /etc/apt/sources.list.d/* \
&& echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware' > /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware' >> /etc/apt/sources.list \
&& echo 'deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware' >> /etc/apt/sources.list \
&& echo 'deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware' >> /etc/apt/sources.list \
&& echo 'deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware' >> /etc/apt/sources.list \
&& echo 'deb-src https://security.debian.org/debian-security bookworm-security main


1538

被折叠的 条评论
为什么被折叠?



