nginx和docker映射正确的文件夹有问题

无论出于何种原因,我一直在获取默认的HTML

我的docker文件在这里/Users/xxx/_sites/_blah

 Dockerfile site.conf docker-compose.yml 

我的代码应用程序在这里/Users/xxx/_sites/_blah/app

这是我的文件:

Dockerfile

 FROM nginx # Change Nginx config here... RUN rm /etc/nginx/conf.d/default.conf ADD ./site.conf /etc/nginx/conf.d/ COPY content /var/www/html/site COPY conf /etc/nginx VOLUME /var/www/html/site VOLUME /etc/nginx/conf.d/ 

泊坞窗,compose.yml

 version: '3.3' services: php: container_name: pam-php image: php:fpm volumes: - ./app:/var/www/html/site nginx: container_name: pam-nginx image: nginx:latest volumes: - ./app:/var/www/html/site:rw - ./site.conf:/etc/nginx/conf.d/site.conf:rw ports: - 7777:80 

site.conf

  server { listen 80; server_name localhost; root /var/www/html/site; error_log /var/log/nginx/localhost.error.log; access_log /var/log/nginx/localhost.access.log; location / { # try to serve file directly, fallback to app.php try_files $uri /index.php$is_args$args; } location ~ ^/.+\.php(/|$) { fastcgi_pass 192.168.59.103:9000; fastcgi_split_path_info ^(.+\.php)(/.*)$; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param HTTPS off; } } 

每个教程或代码块只是不工作或旧。