Skip to content

Commit

Permalink
[Docker] Fixed so that docker demo usage works again
Browse files Browse the repository at this point in the history
  • Loading branch information
vidarl committed Sep 14, 2017
1 parent 55be337 commit a31dc7e
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 0 deletions.
14 changes: 14 additions & 0 deletions 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"]
5 changes: 5 additions & 0 deletions doc/docker/README.md
Expand Up @@ -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
Expand All @@ -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.*
Expand Down
24 changes: 24 additions & 0 deletions 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:

0 comments on commit a31dc7e

Please sign in to comment.