mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-04-27 11:53:46 +03:00
Move dokku to the docs section
This commit is contained in:
parent
cb4e1d0d9d
commit
f02eacaece
|
@ -28,8 +28,6 @@ Features
|
||||||
* 12-Factor_ based settings via django-environ_
|
* 12-Factor_ based settings via django-environ_
|
||||||
* Optimized development and production settings
|
* Optimized development and production settings
|
||||||
* Registration via django-allauth_
|
* Registration via django-allauth_
|
||||||
* Procfile_ for deploying to Heroku
|
|
||||||
* Works great with Dokku
|
|
||||||
* Grunt build for compass and livereload
|
* Grunt build for compass and livereload
|
||||||
* Basic e-mail configurations for sending emails via Mailgun_
|
* Basic e-mail configurations for sending emails via Mailgun_
|
||||||
* Media storage using Amazon S3
|
* Media storage using Amazon S3
|
||||||
|
@ -38,6 +36,8 @@ Features
|
||||||
* Integration with Maildump_ for local email testing (optional)
|
* Integration with Maildump_ for local email testing (optional)
|
||||||
* Integration with Sentry_ for error logging (optional)
|
* Integration with Sentry_ for error logging (optional)
|
||||||
* Docker support using docker-compose_ for dev and prod
|
* Docker support using docker-compose_ for dev and prod
|
||||||
|
* Procfile_ for deploying to Heroku
|
||||||
|
* Works with Dokku
|
||||||
|
|
||||||
.. _Hitch: https://github.com/hitchtest/hitchtest
|
.. _Hitch: https://github.com/hitchtest/hitchtest
|
||||||
.. _Bootstrap: https://github.com/twbs/bootstrap
|
.. _Bootstrap: https://github.com/twbs/bootstrap
|
||||||
|
|
|
@ -236,48 +236,6 @@ Run these commands to deploy the project to Heroku:
|
||||||
heroku run python manage.py createsuperuser
|
heroku run python manage.py createsuperuser
|
||||||
heroku open
|
heroku open
|
||||||
|
|
||||||
Dokku
|
|
||||||
^^^^^
|
|
||||||
|
|
||||||
You need to make sure you have a server running Dokku with at least 1GB of RAM. Backing services are
|
|
||||||
added just like in Heroku however you must ensure you have the relevant Dokku plugins installed.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
cd /var/lib/dokku/plugins
|
|
||||||
git clone https://github.com/rlaneve/dokku-link.git link
|
|
||||||
git clone https://github.com/luxifer/dokku-redis-plugin redis
|
|
||||||
git clone https://github.com/jezdez/dokku-postgres-plugin postgres
|
|
||||||
dokku plugins-install
|
|
||||||
|
|
||||||
You can specify the buildpack you wish to use by creating a file name .env containing the following.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
export BUILDPACK_URL=<repository>
|
|
||||||
|
|
||||||
You can then deploy by running the following commands.
|
|
||||||
|
|
||||||
.. code-block:: bash
|
|
||||||
|
|
||||||
git remote add dokku dokku@yourservername.com:{{cookiecutter.repo_name}}
|
|
||||||
git push dokku master
|
|
||||||
ssh -t dokku@yourservername.com dokku redis:create {{cookiecutter.repo_name}}-redis
|
|
||||||
ssh -t dokku@yourservername.com dokku redis:link {{cookiecutter.repo_name}}-redis {{cookiecutter.repo_name}}
|
|
||||||
ssh -t dokku@yourservername.com dokku postgres:create {{cookiecutter.repo_name}}-postgres
|
|
||||||
ssh -t dokku@yourservername.com dokku postgres:link {{cookiecutter.repo_name}}-postgres {{cookiecutter.repo_name}}
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_SETTINGS_MODULE='config.settings.production'
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
|
|
||||||
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_MAILGUN_SERVER_NAME=YOUR_MAILGUN_SERVER
|
|
||||||
ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py migrate
|
|
||||||
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
|
Docker
|
||||||
^^^^^^
|
^^^^^^
|
||||||
|
|
||||||
|
@ -366,8 +324,6 @@ Place it in `/etc/supervisor/conf.d/{{cookiecutter.repo_name}}.conf` and run::
|
||||||
supervisorctl reread
|
supervisorctl reread
|
||||||
supervisorctl start {{cookiecutter.repo_name}}
|
supervisorctl start {{cookiecutter.repo_name}}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
To get the status, run::
|
To get the status, run::
|
||||||
|
|
||||||
supervisorctl status
|
supervisorctl status
|
||||||
|
@ -390,3 +346,10 @@ If you want to scale your application, run::
|
||||||
|
|
||||||
|
|
||||||
**Don't run the scale command on postgres or celerybeat**
|
**Don't run the scale command on postgres or celerybeat**
|
||||||
|
|
||||||
|
Dokku
|
||||||
|
^^^^^^
|
||||||
|
|
||||||
|
`Instructions for deploying with Dokku`_ can be found in the docs.
|
||||||
|
|
||||||
|
.. _`Instructions for deploying with Dokku`: https://github.com/pydanny/cookiecutter-django/blob/master/%7B%7Bcookiecutter.repo_name%7D%7D/docs/deploy.rst
|
||||||
|
|
41
{{cookiecutter.repo_name}}/docs/dokku.rst
Normal file
41
{{cookiecutter.repo_name}}/docs/dokku.rst
Normal file
|
@ -0,0 +1,41 @@
|
||||||
|
Dokku
|
||||||
|
=====
|
||||||
|
|
||||||
|
You need to make sure you have a server running Dokku with at least 1GB of RAM. Backing services are
|
||||||
|
added just like in Heroku however you must ensure you have the relevant Dokku plugins installed.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
cd /var/lib/dokku/plugins
|
||||||
|
git clone https://github.com/rlaneve/dokku-link.git link
|
||||||
|
git clone https://github.com/luxifer/dokku-redis-plugin redis
|
||||||
|
git clone https://github.com/jezdez/dokku-postgres-plugin postgres
|
||||||
|
dokku plugins-install
|
||||||
|
|
||||||
|
You can specify the buildpack you wish to use by creating a file name .env containing the following.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
export BUILDPACK_URL=<repository>
|
||||||
|
|
||||||
|
You can then deploy by running the following commands.
|
||||||
|
|
||||||
|
.. code-block:: bash
|
||||||
|
|
||||||
|
git remote add dokku dokku@yourservername.com:{{cookiecutter.repo_name}}
|
||||||
|
git push dokku master
|
||||||
|
ssh -t dokku@yourservername.com dokku redis:create {{cookiecutter.repo_name}}-redis
|
||||||
|
ssh -t dokku@yourservername.com dokku redis:link {{cookiecutter.repo_name}}-redis {{cookiecutter.repo_name}}
|
||||||
|
ssh -t dokku@yourservername.com dokku postgres:create {{cookiecutter.repo_name}}-postgres
|
||||||
|
ssh -t dokku@yourservername.com dokku postgres:link {{cookiecutter.repo_name}}-postgres {{cookiecutter.repo_name}}
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_SECRET_KEY=RANDOM_SECRET_KEY_HERE
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_SETTINGS_MODULE='config.settings.production'
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_ACCESS_KEY_ID=YOUR_AWS_ID_HERE
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_SECRET_ACCESS_KEY=YOUR_AWS_SECRET_ACCESS_KEY_HERE
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_AWS_STORAGE_BUCKET_NAME=YOUR_AWS_S3_BUCKET_NAME_HERE
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
|
||||||
|
ssh -t dokku@yourservername.com dokku config:set {{cookiecutter.repo_name}} DJANGO_MAILGUN_SERVER_NAME=YOUR_MAILGUN_SERVER
|
||||||
|
ssh -t dokku@yourservername.com dokku run {{cookiecutter.repo_name}} python manage.py migrate
|
||||||
|
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.
|
Loading…
Reference in New Issue
Block a user