4 mygpo can be run using `Docker <https://docker.com/>`_.
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
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
51 The image exposes the web interface on port 8000.