mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2024-11-10 19:57:09 +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_
|
||||
* Optimized development and production settings
|
||||
* Registration via django-allauth_
|
||||
* Procfile_ for deploying to Heroku
|
||||
* Works great with Dokku
|
||||
* Grunt build for compass and livereload
|
||||
* Basic e-mail configurations for sending emails via Mailgun_
|
||||
* Media storage using Amazon S3
|
||||
|
@ -38,6 +36,8 @@ Features
|
|||
* Integration with Maildump_ for local email testing (optional)
|
||||
* Integration with Sentry_ for error logging (optional)
|
||||
* Docker support using docker-compose_ for dev and prod
|
||||
* Procfile_ for deploying to Heroku
|
||||
* Works with Dokku
|
||||
|
||||
.. _Hitch: https://github.com/hitchtest/hitchtest
|
||||
.. _Bootstrap: https://github.com/twbs/bootstrap
|
||||
|
|
|
@ -28,7 +28,7 @@ DJANGO_SECURE_HSTS_INCLUDE_SUBDOMAINS HSTS_INCLUDE_SUBDOMAINS n/a
|
|||
DJANGO_SESSION_COOKIE_HTTPONLY SESSION_COOKIE_HTTPONLY n/a True
|
||||
DJANGO_SESSION_COOKIE_SECURE SESSION_COOKIE_SECURE n/a False
|
||||
DJANGO_DEFAULT_FROM_EMAIL DEFAULT_FROM_EMAIL n/a "{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>"
|
||||
DJANGO_SERVER_EMAIL SERVER_EMAIL n/a "{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>"
|
||||
DJANGO_SERVER_EMAIL SERVER_EMAIL n/a "{{cookiecutter.project_name}} <noreply@{{cookiecutter.domain_name}}>"
|
||||
DJANGO_EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a "[{{cookiecutter.project_name}}] "
|
||||
======================================= =========================== ============================================== ======================================================================
|
||||
|
||||
|
@ -227,57 +227,15 @@ Run these commands to deploy the project to Heroku:
|
|||
|
||||
heroku config:set DJANGO_MAILGUN_SERVER_NAME=YOUR_MALGUN_SERVER
|
||||
heroku config:set DJANGO_MAILGUN_API_KEY=YOUR_MAILGUN_API_KEY
|
||||
|
||||
|
||||
heroku config:set PYTHONHASHSEED=random
|
||||
|
||||
|
||||
git push heroku master
|
||||
heroku run python manage.py migrate
|
||||
heroku run python manage.py check --deploy
|
||||
heroku run python manage.py createsuperuser
|
||||
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
|
||||
^^^^^^
|
||||
|
||||
|
@ -366,8 +324,6 @@ Place it in `/etc/supervisor/conf.d/{{cookiecutter.repo_name}}.conf` and run::
|
|||
supervisorctl reread
|
||||
supervisorctl start {{cookiecutter.repo_name}}
|
||||
|
||||
|
||||
|
||||
To get the status, run::
|
||||
|
||||
supervisorctl status
|
||||
|
@ -390,3 +346,10 @@ If you want to scale your application, run::
|
|||
|
||||
|
||||
**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