虽然我在外部卷上安装数据,但docker-compose down
我丢失了数据。我使用的是docker-compose版本1.14.0, build c7bdf9e
和docker版本17.06.1-ce, build 874a737
# docker-compose.yml
version: '3'
services:
db:
image: postgres
volumes:
- data:/var/lib/postgres/data
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
depends_on:
- db
volumes:
data:
external: true