Sign inSign up

sjwayrhz/nginx

By sjwayrhz

Updated 10 months ago

Image
0

165

sjwayrhz/nginx repository overview

如果需要通过sjwayrhz/nginx:alpine-slim-1.29.3创建网页映射文件的dockerfile,如下用例:

FROM sjwayrhz/nginx:alpine-slim-1.29.3
ADD . /data
RUN rm -f /data/Dockerfile
CMD ["nginx", "-g", "daemon off;"]

然后构建镜像

docker build -t sjwayrhz/nginx:latest

与这个Dockerfile统一目录下的所有文件都会被打包到容器的/data目录。 假设这样启动

docker run -d -p 80:80 sjwayrhz/nginx:latest

附件: file.conf关键配置文件如下:

server {
    listen      80;
    server_name localhost;
    charset utf-8;
    root /data;
    location / {
        autoindex on;
        autoindex_exact_size on;
        autoindex_localtime on;
    }
}

Tag summary

Content type

Image

Digest

sha256:98279be28

Size

5.4 MB

Last updated

10 months ago

docker pull sjwayrhz/nginx:alpine-slim-1.29.3