Start Docker support [WIP]
[mygpo.git] / doc / ops / docker.rst
blob9ee0907b1d86ccad1efe87e8e272a1467a84170a
1 Using Docker
2 ============
4 mygpo can be run using `Docker <https://docker.com/>`_.
7 Database
8 --------
10 The image requires a PostgreSQL server, specified either via
12 * a `linked container <https://docs.docker.com/userguide/dockerlinks/>`_
13   called ``db`` containing a server with a database called ``mygpo``, a user
14   called ``mygpo`` with a password ``mygpo``.
15 * A ``DATABASE_URL`` environment variable (eg
16   ``postgres://USER:PASSWORD@HOST:PORT/NAME``)
18 Using a PostgreSQL Docker container
19 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
21 Start a container using the `official PostgreSQL image <https://registry.hub.docker.com/_/postgres/>`_. ::
23     docker run --name db -d postgres
25 Create the schema and a corresponding user ::
27     docker exec -it db psql -U postgres
29 And enter the following commands (change passwords as required)
31 .. literalinclude:: ../../contrib/init-db.sql
32     :language: sql
33     :linenos:
35 Initialize the tables. This needs needs to be run for every update. ::
37     sudo docker run --rm --link db:db -e SECRET_KEY=asdf mygpo/web python manage.py migrate
40 Elasticsearch
41 -------------
44 Redis
45 -----
48 Web Frontend
49 ------------
51 The image exposes the web interface on port 8000.
54 Celery Worker
55 -------------
58 Celery Heartbeat
59 ----------------