use nginx + php-fpm to create the basic http(s) server
- Easy to publish your site/api project
- Easy to build your owned image, only need to copy project root to docker ${WORKDIR} (/app/)
- Easy to development your project, only need to run dachichang/nginx-php-fpm and use volume mount project root to ${WORKDIR} (/app/)
- NOTICE: nginx document root will bind ${WORKDIR}/public and use index.php as index
- project layout (suggest)
./public/index.php ./vendor ./src ./lib
- create new Dockerfile
- add layer below
FROM dachichang/nginx-php-fpm COPY web_resources ./
- docker build -t APP_NAME:VERSION .
- docker run --rm -d -p 80:80 --name CONTAINER_NAME APP_NAME:VERSION