switch to named docker volumes

This commit is contained in:
Jannis Gebauer 2016-04-08 08:31:02 +02:00
parent c521458928
commit 0954ec8dad
4 changed files with 19 additions and 7 deletions

View File

@ -2,6 +2,10 @@
All enhancements and patches to cookiecutter-django will be documented in this file. All enhancements and patches to cookiecutter-django will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/). This project adheres to [Semantic Versioning](http://semver.org/).
### [2016-04-08]
### Changed
- Move to named docker volumes (@jayfk)
### [2016-04-07] ### [2016-04-07]
### Changed ### Changed
- Pycharm Support (including debugging in Docker) @noisy - Pycharm Support (including debugging in Docker) @noisy

View File

@ -41,7 +41,7 @@ This pass all incoming requests on `nginx-proxy`_ to the nginx service your appl
.. _nginx-proxy: https://github.com/jwilder/nginx-proxy .. _nginx-proxy: https://github.com/jwilder/nginx-proxy
Postgres is saving its database files to `/data/{{cookiecutter.repo_name}}/postgres` by default. Change that if you wan't Postgres is saving its database files to the `postgres_data` volume by default. Change that if you wan't
something else and make sure to make backups since this is not done automatically. something else and make sure to make backups since this is not done automatically.
To get started, pull your code from source control (don't forget the `.env` file) and change to your projects root To get started, pull your code from source control (don't forget the `.env` file) and change to your projects root

View File

@ -1,12 +1,15 @@
version: '2' version: '2'
volumes:
postgres_data_dev: {}
postgres_backup_dev: {}
services: services:
postgres: postgres:
build: ./compose/postgres build: ./compose/postgres
volumes: volumes:
# If you are using boot2docker, postgres data has to live in the VM for now until #581 is fixed - postgres_data_dev:/var/lib/postgresql/data
# for more info see here: https://github.com/boot2docker/boot2docker/issues/581 - postgres_backup_dev:/backups
- /data/dev/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data
- /data/dev/{{cookiecutter.repo_name}}/postgres-backups:/backups
environment: environment:
- POSTGRES_USER={{cookiecutter.repo_name}} - POSTGRES_USER={{cookiecutter.repo_name}}

View File

@ -1,10 +1,15 @@
version: '2' version: '2'
volumes:
postgres_data: {}
postgres_backup: {}
services: services:
postgres: postgres:
build: ./compose/postgres build: ./compose/postgres
volumes: volumes:
- /data/{{cookiecutter.repo_name}}/postgres:/var/lib/postgresql/data - postgres_data:/var/lib/postgresql/data
- /data/{{cookiecutter.repo_name}}/postgres-backups:/backups - postgres_backup:/backups
env_file: .env env_file: .env
django: django: