init
This commit is contained in:
parent
2ea5b4077b
commit
232f2a32da
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@ -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;"]
|
Loading…
Reference in New Issue
Block a user