title: docker-compose: how to see file-changes instantly (when developing)
body: <p>I am new to docker, so this may seem very basic to you, anyway - its freaking me out at the moment.</p>
  
  <p>I decided to develop a new web-project ontop of containers, of course i thought about docker. After finishing the tutorial and reading some Dockerfiles and so on, i decided to go with docker-compose.</p>
  
  <p>I want to have multiple compose-files, one for Development, one for Production and so on. Now i managed to orchestrate a basic php/mysql/redis application using 3 different services. The main application is php based and maintained in the project src. Mysql and Redis are simply configured with base images and do not require any business logic.</p>
  
  <p>I can build the containers and bring them up with</p>
  
  <p>build:</p>
  
  <pre><code>docker-compose -f compose-Development.yml build
  </code></pre>
  
  <p>up:</p>
  
  <pre><code>docker-compose -f compose-Development.yml up
  </code></pre>
  
  <p>Many files in the main application container are built by gulp (templates, css, etc) and code will exist in both javascript and php.</p>
  
  <p>I noticed, that my app state does not change when i change my files. I would have to rebuild and restart my containers.</p>
  
  <p>Having some experience with Vagrant, i would go for some kind of shared source during development. But how would i achieve that?</p>
  
  <p>My application Dockerfile (for development) looks like this:</p>
  
  <pre><code>FROM webdevops/php-nginx:7.1
  COPY ./ /app
  COPY docker/etc/ /opt/docker/etc
  
  # php config...
  RUN ln -sf /opt/docker/etc/php/php.Development.ini /opt/docker/etc/php/php.ini
  
  WORKDIR /app/
  EXPOSE 80
  </code></pre>
  
  <p>The compose file:</p>
  
  <pre><code>version: "3"
  services:
  
    app:
      build:
        context: .
        dockerfile: Dockerfile.Development
      links:
        - mysql
        - redis
      volumes:
        - ./data/fileadmin:/app/public/fileadmin
        - ./data/uploads:/app/public/uploads
      env_file:
        - docker/env/All.yml
        - docker/env/Development.yml
      ports:
        - "80:80"
      restart: always
  
    # Mysql Container
    mysql:
      build:
        context: docker/mysql/
        dockerfile: Dockerfile
      restart: always
      volumes:
        - mysql:/var/lib/mysql
      env_file:
        - docker/env/All.yml
        - docker/env/Development.yml
  
    # Cache Backend Container
    redis:
      build:
        context: docker/redis/
        dockerfile: Dockerfile
      ports:
        - "6379:6379"
      volumes:
        - redis:/data
      env_file:
        - docker/env/All.yml
        - docker/env/Development.yml
      restart: always
  
  volumes:
    mysql:
    redis:
  </code></pre>
  
  <p>So far, i used some github repositories to copy chunks from. I know there might be other problems in my setup as well, for the moment the most blocking issue is the thing with the linked/copied source.</p>
  
  <p>Kind regards,
  Philipp</p>