nginx 镜像

Dockerfile

FROM nginx

COPY nginx.conf /etc/nginx/conf.d/default.conf

nginx.conf

server {
    listen 80;
    server_name 0.0.0.0;

    location / {
        root /www/_book/;
        index index.html;
    }
}
# 创建镜像
sudo docker build -t nginx-custom docker/nginx
# 运行容器
sudo docker run -d -p 80:80 -v "$PWD:/www" --name=chengwanlu-com-serve nginx-custom

results matching ""

    No results matching ""