diff --git a/doc/docker/Dockerfile-demo-vardir b/doc/docker/Dockerfile-demo-vardir new file mode 100644 index 00000000..aff6c4c4 --- /dev/null +++ b/doc/docker/Dockerfile-demo-vardir @@ -0,0 +1,14 @@ +FROM busybox + +COPY ./web/var /var/www/web/var + +WORKDIR /var/www + +# Fix permissions for www-data +RUN chown -R www-data:www-data web/var \ + && find web/var -type d -print0 | xargs -0 chmod -R 775 \ + && find web/var -type f -print0 | xargs -0 chmod -R 664 + +VOLUME ["/var/www/web/var"] + +CMD ["/bin/true"] diff --git a/doc/docker/README.md b/doc/docker/README.md index 71c80346..33651c61 100644 --- a/doc/docker/README.md +++ b/doc/docker/README.md @@ -52,6 +52,9 @@ However below environment variable `COMPOSE_FILE` is used instead since this is ### Production / Demo "image" use +Using this approach, everything will run in containers and volumes. This means that if you for instance upload a image +using the eZ Platform backend, that image will land in a volume, not somewhere below web/var/ in your project directory. + From root of your projects clone of this distribution, [setup composer auth.json](#composer) and execute the following: ```sh export COMPOSE_FILE=doc/docker/base-prod.yml @@ -70,6 +73,8 @@ After some 5-10 seconds you should be able to browse the site on `localhost:8080 ### Development "mount" use +Using this approach, your project directory will be bind mounted into the nginx and php containers. So if you change a +php file in for instance src/, that change will kick in automatically. Warning: *Dev setup works a lot faster on Linux then on Windows/Mac where Docker uses virtual machines using shared folders by default under the hood, which leads to much slower IO performance.* diff --git a/doc/docker/demo.yml b/doc/docker/demo.yml new file mode 100644 index 00000000..396f854a --- /dev/null +++ b/doc/docker/demo.yml @@ -0,0 +1,24 @@ +version: '3.3' + +services: + app: + volumes: + - vardir:/var/www/web/var + depends_on: + - demo-vardir + + web: + volumes: + - vardir:/var/www/web/var:ro + + demo-vardir: + build: + context: ../../ + dockerfile: doc/docker/Dockerfile-demo-vardir + volumes: + - vardir:/var/www/web/var:ro + networks: + - backend + +volumes: + vardir: