I am pretty new with all of this docker stuff and I have this docker-compose.yml
file:
fpm:
build:
context: "./php-fpm"
dockerfile: "my-fpm-dockerfile"
restart: "always"
ports:
- "9002:9000"
volumes:
- ./src:/var/www/src
depends_on:
- "db"
nginx:
build:
context: "./nginx"
dockerfile: "my-nginx-dockerfile"
restart: "always"
ports:
- "8084:80"
volumes:
- ./docker/logs/nginx/:/var/log/nginx:cached
- ./src:/var/www/src
depends_on:
- "fpm"
I am curious why do I need to add my project files in the fpm
container as well as in the nginx
?
Why isn't it enough to add it just only to my webserver? A web server is a place that holds the files and handles the request...
I believe that this information would be useful to other docker newbies as well.
Thanks in advance.