Docker volume is empty, not picking up any files
I’m trying to set up Docker locally (and eventually in production), but right now, I can’t even get volumes mounted right. I have been following this tutorial, which is clearly outdated since Docker has been changing so rapidly for the past year, tutorials and git issues can not keep up.
My question is, where is my index.php file in my docker container? Why isn’t it showing up, despite being specified in my volumes directive? I even enabled autoindex in my nginx config so I could actually see the directory and prove my suspicions.
I’m on Windows 10
Here’s my directory tree:
myproject/ -nginx/ -default.conf (nginx config) -Dockerfile -docker-compose.yml -index.php (trying to hit this in browser)
Here is my docker-compose file:
nginx: build: ./nginx/ ports: - 80:80 links: - php volumes: - .:/var/www/html php: image: php:5.6-fpm expose: - 9000 volumes: - .:/var/www/html
And my Dockerfile:
FROM nginx:latest MAINTAINER My Name <firstname.lastname@example.org> COPY ./default.conf /etc/nginx/conf.d/default.conf
Then I run:
D:\Projects\myproject> docker-compose up -d (--build if I've made changes)
And then I hit localhost and get the nginx welcome page. But index.php isn’t there! What gives? Please school me, thanks in advance.