title: Docker data-only container and dealing with new releases
body: <p>I've been researching a lot of practices around Docker and have come quite far.
  But there's one thing that keeps on puzzling me, working with data-only containers.</p>
  
  <p>Here's a brief overview of my current setup:</p>
  
  <pre><code># nginx
  web:
    extends:
      file: _common.yml
      service: web
    ports:
      - "80:80"
    environment:
      APPLICATION_ENV: prod
    volumes_from:
      - data
    links:
      - db
      - redis
  
  # php5-cli
  app:
    extends:
      file: _common.yml
      service: app
    environment:
      APPLICATION_ENV: prod
    volumes_from:
      - data
    links:
      - db
      - redis
  
  data:
    image: &lt;censored-url&gt;
    volumes:
      - "/var/lib/mysql"
      - "/app"
  
  # percona
  db:
    extends:
      file: _common.yml
      service: db
    volumes_from:
      - data
  
  # redis
  redis:
    extends:
      file: _common.yml
      service: redis
  </code></pre>
  
  <p>The <code>&lt;censored-url&gt;</code> that you see is an image build with this Dockerfile:</p>
  
  <pre><code>FROM busybox
  COPY . /app
  </code></pre>
  
  <p>Now this setup works but I just can't figure out how to handle a new release.
  My source is in git, when I want to deploy to production I imagine I create a new image (FROM busybox should probably be replaced with my existing image url) and pull in the new image on my production server.</p>
  
  <p>But how do I get the data to update for my web container and such? I also have to make sure my persistent data (/var/lib/mysql) remains.</p>
  
  <p>I hope the question is clear, I'd be happy to clarify when necessary.</p>