Docker documentation, development user.

parent 231fd13f
......@@ -26,13 +26,9 @@ Download and install below system requirements to get started:
- [git]( (download and install)
- [python3]( (download and install)
- [direnv]( (download and install, then follow [setup instructions](
- [rabbitmq]( (for scanners only, download and install)
After installation of above tools, all following steps use the command line:
sudo easy_install pip # installs pip, a python package manager, with the command pip3
- Tox (`pip3 install --user tox`)
- [direnv]( (optional, download and install, then follow [setup instructions](, see Direnv section below)
- [Docker]( (optional, recommended, follow instructions to install.)
# Obtaining the software
......@@ -44,16 +40,82 @@ In a directory of your choosing:
# enter the directory of the downloaded software
cd admin
# sets Debug to true in this folder. Do not change the file.
Use Direnv to manage environment (see Direnv section below). This manages the Python Virtualenv and `DEBUG` setting required for local development.
direnv allow
# Quickstart
For the quickstart we assume the usage of Docker as it offers the most complete environment for development. This project aims to be environment agnostic and development without Docker is possible. See Development section below.
Below commands result in a failmap installation that is suitable for testing and development. It is
capable of handling thousands of urls and still be modestly responsive.
If you need a faster, more robust installation, please [contact us](
Ensure Docker is installed and running. Execute the following command to bring up the environment:
docker-compose up
This will build and start all required components and dependencies to run a complete instance of the Failmap project (grab some coffee the first time this takes a while).
You can now visit the [map website]( and/or the
[admin website]( at (credentials: admin:faalkaart).
To stop the environment simply press [CTRL][C].
The environment is aware of code changes in the `failmap_admin` folder. Services are automatically restarted to reflect the latest changes.
It is possible to start the environment in the background using:
docker-compose up -d
This can be shutdown using `docker-compose down`
To view (and follow) all logs run:
docker-compose logs -f
To see all running components:
$ docker-compose ps
Name Command State Ports
admin_admin_1 /usr/local/bin/autoreload ... Up>8000/tcp
admin_broker_1 redis ... Up>5672/tcp, 6379/tcp
admin_database_1 mysqld Up>3306/tcp
admin_loaddata_1 /usr/local/bin/failmap-adm ... Exit 0
admin_migrate_1 /usr/local/bin/failmap-adm ... Exit 0
admin_worker_1 /usr/local/bin/autoreload ... Up 8000/tcp
The platform consists of 2 external dependencies `broker` (redis), `database` (mysql) and 2 main components `admin` (web frontend and administrative environment), `worker` (async task executor).
Two tasks are run at startup `migrate` (database schema management) and `loaddata` (test and development data loading).
Most composer commands can be run against individual components, eg:
docker-compose logs -f worker
For more information consult docker composer [documentation]( or:
docker-compose -h
# Development
To perform non-Docker development, make sure all Requirements are installed. Run the following script to setup a development instance:
After this run:
# finally start the development server
failmap-admin runserver
Now visit the [map website]( and/or the
[admin website]( at (credentials: admin:faalkaart).
The setup script performs the following steps:
# download even more requirements needed to run this software
pip3 install -e .
......@@ -61,7 +123,7 @@ If you need a faster, more robust installation, please [contact us](mailto:hosti
failmap-admin migrate
# create a user to view the admin interface
failmap-admin createsuperuser
failmap-admin loaddata development
# loads a series of sample data into the database
failmap-admin load-dataset testdata
......@@ -69,12 +131,6 @@ If you need a faster, more robust installation, please [contact us](mailto:hosti
# calculate the scores that should be displayed on the map
failmap-admin rebuild-ratings
# finally start the development server
failmap-admin runserver
Now visit the [map website]( and/or the
[admin website]( at
# Scanning services (beta)
Todo: add celery beat information
......@@ -73,12 +73,13 @@ services:
- .:/source/
- 8080:8000
- 8000:8000
# django decides what to log based on type of console
tty: true
entrypoint: [ '/usr/local/bin/autoreload', 'failmap-admin']
command: [ "runuwsgi" ]
# migrate
image: failmap/admin
......@@ -90,3 +91,15 @@ services:
tty: true
command: [ "migrate" ]
image: failmap/admin
context: .
dockerfile: "${PWD}/Dockerfile"
- database:mysql
tty: true
command: [ "loaddata", "development", "testdata" ]
Application specific fixtures (user accounts, settings) for different environments.
# Development
Contains a admin user for use during development. Username `admin`, password: `faalkaart`.
failmap-admin loaddata development
- model: auth.user
pk: 1
password: pbkdf2_sha256$36000$AVp6H74Dcqmy$5L1bnfpvg06UCs9XRrC+5lXjx4KUhHEWtEMgFrXeggo=
last_login: null
is_superuser: true
username: admin
first_name: ''
last_name: ''
is_staff: true
is_active: true
date_joined: 2017-10-30 14:32:44.614938+00:00
groups: []
user_permissions: []
......@@ -6,6 +6,8 @@ set -ve
pip3 install -e .
failmap-admin migrate
# failmap-admin load-dataset dev_user
# load development environment users/settings
failmap-admin load-dataset development
# load a test data set
failmap-admin load-dataset testdata -v0
failmap-admin rebuild-ratings -v0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment