未find文件 – Docker中的Nginx

描述

我有一个docker容器与此

nginx.conf

server { listen 80; index index.php index.html; root /var/www/public; location / { try_files $uri /index.php?$args; } location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass app:9000; fastcgi_index index.php; include fastcgi_params; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; } } 

泊坞窗,compose.yaml

 version: '2' services: # The Application app: build: context: ./ dockerfile: app.dockerfile working_dir: /var/www volumes: - ./:/var/www environment: - "DB_PORT=3306" - "DB_HOST=database" # The Web Server web: build: context: ./ dockerfile: web.dockerfile working_dir: /var/www volumes_from: - app ports: - 85:80 # The Database database: image: mysql:5.6 volumes: - dbdata:/var/lib/mysql environment: - "MYSQL_DATABASE=homestead" - "MYSQL_USER=homestead" - "MYSQL_PASSWORD=secret" - "MYSQL_ROOT_PASSWORD=secret" ports: - "33062:3306" volumes: dbdata: 

docker似乎build立并开始成功

 docker-compose up -d docker_app_1 is up-to-date docker_database_1 is up-to-date Recreating docker_web_1 ... Recreating docker_web_1 ... done 

但我一直在得到

文件未find。


问题

如何进一步debugging呢?


目前我接受任何build议。

任何提示/build议/对此的帮助将非常感激!

用docker exec -it xxxxxx bash启动你的容器

一旦你这样做,你将在容器内。 现在根据你的docker-compose文件检查你的文件是否在你要放置的位置。