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.
Here's a brief overview of my current setup:
# 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: <censored-url>
volumes:
- "/var/lib/mysql"
- "/app"
# percona
db:
extends:
file: _common.yml
service: db
volumes_from:
- data
# redis
redis:
extends:
file: _common.yml
service: redis
The <censored-url>
that you see is an image build with this Dockerfile:
FROM busybox
COPY . /app
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.
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.
I hope the question is clear, I'd be happy to clarify when necessary.