mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-03-03 19:08:15 +03:00
added docker-compose documentation
This commit is contained in:
parent
7690b42c27
commit
35d61c9eee
30
README.rst
30
README.rst
|
@ -29,6 +29,7 @@ Features
|
|||
* Serve static files from Amazon S3 or Whitenoise_ (optional)
|
||||
* Pre configured Celery_ (optional)
|
||||
* Integration with Maildump_ for local email testing (optional)
|
||||
* Docker support using docker-compose_ for dev and prod
|
||||
|
||||
.. _Bootstrap: https://github.com/twbs/bootstrap
|
||||
.. _AngularJS: https://github.com/angular/angular.js
|
||||
|
@ -41,6 +42,7 @@ Features
|
|||
.. _Whitenoise: https://whitenoise.readthedocs.org/
|
||||
.. _Celery: http://www.celeryproject.org/
|
||||
.. _Maildump: https://github.com/ThiefMaster/maildump
|
||||
.. _docker-compose: https://www.github.com/docker/compose
|
||||
|
||||
|
||||
Constraints
|
||||
|
@ -156,6 +158,34 @@ To get live reloading to work you'll probably need to install an `appropriate br
|
|||
|
||||
It's time to write the code!!!
|
||||
|
||||
Getting up and running using docker
|
||||
----------------------------------
|
||||
|
||||
The steps below will get you up and running with a local development environment. We assume you have the following installed:
|
||||
|
||||
* docker
|
||||
* docker-compose
|
||||
|
||||
Open a terminal at the project root and run the following for local development::
|
||||
|
||||
$ docker-compose -f dev.yml up
|
||||
|
||||
You can also set the environment variable ``COMPOSE_FILE`` pointing to ``dev.yml`` like this::
|
||||
|
||||
$ export COMPOSE_FILE=dev.yml
|
||||
|
||||
And then run::
|
||||
|
||||
$ docker-compose up
|
||||
|
||||
|
||||
To migrate your app and to create a superuser, run::
|
||||
|
||||
$ docker-compose run django python manage.py migrate
|
||||
|
||||
$ docker-compose run django python manage.py createsuperuser
|
||||
|
||||
|
||||
For Readers of Two Scoops of Django 1.8
|
||||
--------------------------------------------
|
||||
|
||||
|
|
|
@ -155,7 +155,7 @@ It's time to write the code!!!
|
|||
Deployment
|
||||
------------
|
||||
|
||||
It is possible to deploy to Heroku or to your own server by using Dokku, an open source Heroku clone.
|
||||
It is possible to deploy to Heroku, to your own server by using Dokku, an open source Heroku clone or using docker-compose.
|
||||
|
||||
Heroku
|
||||
^^^^^^
|
||||
|
@ -232,3 +232,17 @@ You can then deploy by running the following commands.
|
|||
ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py createsuperuser
|
||||
|
||||
When deploying via Dokku make sure you backup your database in some fashion as it is NOT done automatically.
|
||||
|
||||
Docker
|
||||
^^^^^^
|
||||
|
||||
You need a working docker and docker-compose installation on your production server.
|
||||
|
||||
To get started, clone the git repo containing your projects code and set all needed environment variables in
|
||||
``env.production``.
|
||||
|
||||
To start docker-compose in the foreground, run:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
docker-compose up
|
||||
|
|
Loading…
Reference in New Issue
Block a user