【发布时间】:2018-04-17 08:51:09
【问题描述】:
说明
我有一个带有这个的 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;
}
}
docker-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似乎构建并启动成功
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
但我一直得到
找不到文件。
如何调试这个?
【问题讨论】:
-
您介意分享您的 docker-compose 文件吗?
-
@Sergiu :根据要求,我将我的 docker-compose.yaml 包含在帖子中。
-
@kyo 你有什么解决办法吗?我也遇到了类似的错误
标签: php laravel docker nginx docker-compose