summaryrefslogtreecommitdiff
path: root/docs/deploy.rst
blob: c21847fc5ee63bcb69c17fb454f130c61b90167c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Deployment
==========

Docker
------


Local prerequisites
*******************

You will need to install Docker and
`docker-compose <https://docs.docker.com/compose/install/>`_ before
performing the following steps.

Usage
*****

1. Build ``Saleor`` with ``docker-compose``

   .. code::

    $ docker-compose build


2. Prepare the database

   .. code::

    $ docker-compose run web python manage.py migrate
    $ docker-compose run web python manage.py populatedb --createsuperuser

   The ``--createsuperuser`` switch creates an admin account for
    ``admin@example.com`` with the password set to ``admin``.


3. Run ``Saleor``

   .. code::

    $ docker-compose up


By default, the application is configured to listen on port ``8000``.


Heroku
------

First steps
***********

.. code::

 $ heroku create --buildpack https://github.com/heroku/heroku-buildpack-nodejs.git
 $ heroku buildpacks:add https://github.com/heroku/heroku-buildpack-python.git
 $ heroku addons:create heroku-postgresql
 $ heroku addons:create heroku-redis
 $ heroku config:set SECRET_KEY='<your secret key here>'
 $ heroku config:set ALLOWED_HOSTS='<your hosts here>'


.. note::
 Heroku's storage is volatile. This means that all instances of your application will have separate disks and will lose all changes made to the local disk each time the application is restarted. The best approach is to use cloud storage such as [[Amazon S3|Storage: Amazon S3]].


Deploy
******

.. code::

 $ git push heroku master


Prepare the database
********************

.. code::

 $ heroku run python manage.py migrate