dockware
Search…
Persisting Data
We learned to avoid bind-mounting. But what if you want to persist data to have it all available again after recreating your containers?
Docker offers a way of using internal volumes to persist data. And that works fast, really fast.
So if you want to persist the state of your current work, use internal volume mountings and just do plain SFTP from your host.
Here's an example of a docker-compose.yml that persists the DocRoot of your shop and also your database:
docker-compose.yml
1
version: "3"
2
3
services:
4
5
shopware:
6
image: dockware/play:latest
7
container_name: shopware
8
volumes:
9
- "db_volume:/var/lib/mysql"
10
- "shop_volume:/var/www/html"
11
networks:
12
- web
13
14
volumes:
15
db_volume:
16
driver: local
17
shop_volume:
18
driver: local
19
20
networks:
21
web:
22
external: false
Copied!
Last modified 8mo ago
Copy link