From 232f2a32da23384cf5783fde966699b770d2bc11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B6=85=E5=AF=BC=E4=BD=93=E5=85=83=E7=B4=A0?= <2195134613@qq.com> Date: Tue, 28 May 2024 22:45:11 +0800 Subject: [PATCH] init --- Dockerfile | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..236ee0e --- /dev/null +++ b/Dockerfile @@ -0,0 +1,18 @@ +# 使用官方 Nginx 镜像作为基础镜像 +FROM nginx:latest + +# 设置工作目录 +WORKDIR /usr/share/nginx/html + +# 将当前目录下的网站内容复制到容器中的 Nginx 网页根目录 +COPY . . + +# (可选)如果需要,可以移除默认的 Nginx 配置文件,并复制自定义的配置文件 +# RUN rm /etc/nginx/conf.d/default.conf +# COPY nginx.conf /etc/nginx/conf.d/ + +# (可选)如果需要,暴露 80 和 443 端口 +EXPOSE 80 + +# 定义容器启动时执行的命令,启动 Nginx 服务 +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file