Development improvements.

parent 53e9ecaa
......@@ -59,6 +59,8 @@ Ensure Docker is installed and running. Execute the following command to bring u
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).
Notice: MySQL/Redis connection errors might be shown during startup. This is normal as the database container takes some time to startup. All related actions will be retried until they succeed. To check everything is correct see the `docker-compose ps` command below for the expected output.
You can now visit the [map website](http://127.0.0.1:8000/) and/or the
[admin website](http://127.0.0.1:8000/admin/) at http://127.0.0.1:8000 (credentials: admin:faalkaart).
......@@ -96,7 +98,7 @@ To see all running components:
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).
Two tasks are run at startup `migrate` (database schema management) and `loaddata` (test and development data loading). The status of `Exit 0` indicated they have completed without issues.
Most composer commands can be run against individual components, eg:
......
......@@ -45,11 +45,12 @@ services:
environment:
BROKER: redis://broker:6379/0
DJANGO_DATABASE: production
TERM: xterm-color
DEBUG: 1
# mount current source into container to allow changes to propagate without container rebuild
volumes:
- .:/source/
# let celery be a little more informative regarding console messages
tty: true
# use watchdog to provide auto restart functionality on changed code
entrypoint: [ '/usr/local/bin/autoreload', 'failmap-admin']
command: [ "celery", "worker", "-l", "info", "-c", "6" ]
......@@ -67,13 +68,14 @@ services:
BROKER: redis://broker:6379/0
DJANGO_DATABASE: production
UWSGI_PYTHON_AUTORELOAD: "yes"
TERM: xterm-color
DEBUG: 1
# mount current source into container to allow changes to propagate without container rebuild
volumes:
- .:/source/
ports:
- 8000:8000
# django decides what to log based on type of console
tty: true
entrypoint: [ '/usr/local/bin/autoreload', 'failmap-admin']
command: [ "runuwsgi" ]
......@@ -85,10 +87,14 @@ services:
dockerfile: "${PWD}/Dockerfile"
links:
- database:mysql
volumes:
- .:/source/
environment:
DJANGO_DATABASE: production
tty: true
TERM: xterm-color
command: [ "migrate" ]
# retry if action failes (ie: database container is not ready yet)
restart: on-failure
loaddata:
image: failmap/admin
......@@ -97,10 +103,14 @@ services:
dockerfile: "${PWD}/Dockerfile"
links:
- database:mysql
volumes:
- .:/source/
environment:
DJANGO_DATABASE: production
tty: true
TERM: xterm-color
command: [ "load-dataset", "development", "testdata" ]
# retry if action failes (ie: database container is not ready yet)
restart: on-failure
flower:
image: failmap/admin
......@@ -111,7 +121,7 @@ services:
- broker
environment:
BROKER: redis://broker:6379/0
TERM: xterm-color
ports:
- 5555:5555
tty: true
command: [ "celery", "flower" ]
# Extend django-uwsgi command to disable checks at startup.
# By creating the same command in a app that is loaded earlier than django_uwsgi we can
# override the settings of this command.
from django_uwsgi.management.commands.runuwsgi import Command
# During startup of a Django management command 'system checks' can be performed.
# https://docs.djangoproject.com/en/1.11/topics/checks/
# However some of these checks require a working database connection which cannot be
# guaranteed when the application container is started (database container might be initializing).
# For this reason the checks are disabled when running the WSGI server.
# Disable running system checks.
Command.requires_system_checks = False
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