I'm using docker-compose for deployment, with a 2 docker-compose.yml
setup where I'm building the image locally and pulling from docker hub on the server.
Locally:
app:
build: .
volumes:
- "./tmp/volume:/volume"
And on the server:
app:
image: username/repo:tag
volumes:
- "/data/volume:/volume"
Locally my volume mounts to the specified directory fine, with files created by the app persisted there outside the container. On the deployment server, however, this does not happen.
Files are however created and persisted through deploys, even though my deployment script runs docker-compose down -v
which presumably removes named & anonymous volumes on the container.
I'm sure I'm doing something wrong, but I can't see what.