beaw21 / podd-docker

Make development or deployment easier with docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PODD Docker

Make development or deployment easier with docker. Now support only PODD backend related services. For front-end development will coming soon.

Note about included services.

Available services:

  • api
  • celery worker
  • celery beat
  • elasticsearch
  • neo4j
  • postgis
  • redis
  • cep

TO-DO:

  • Add podd-quiz.
  • Add podd-registration.
  • Add podd-rabies-connect.

Prerequisites

git lfs, docker, docker-compose >= 1.8

Preparation

Set environment variables: 0. 3G RAM is recommended.

  1. Create named volumes by run docker volume create --name podd_data.
  2. PODD_API_DIR point to current working Django directory.
  3. PODD_DJANGO_SECRET_KEY
  4. PODD_RAVEN_DSN, optional, if you really want to connect with sentry. Go to docker-host:9000 first to get the DSN.
  5. Recommend autoenv to make your life easier with environment variables.

Run

  1. Specify $PODD_API_DIR to podd-api directory. Ex. export PODD_API_DIR=/path/to/podd-api/podd
  2. docker-compose up -d
  3. By default, the service port is not exposed. You can use docker-compose.override.yml, see config overriding for further instruction : https://docs.docker.com/compose/extends/.
  4. If you want to run sentry.
  5. Go into sentry/ folder.
  6. Run docker-compose up -d
  7. Run docker-compose exec sentry sentry upgrade and create your admin user.
  8. Go to http://docker_host:9200. Get the DSN.

Things to do after services started.

You have 2 options. First, Load current data to postgresql.

  1. psql -U postgres -W -h docker-host -p 5432 < podd-api-data.sql
  2. docker-compose exec api python manage.py rebuild_index -v3
  3. docker-compose exec api python manage.py rebuild_graph

Or init the bare backend.

  1. docker-compose run api python manage.py migrate

Plan

  1. Add uwsgi service for production
  2. Include nodejs-related services.
  3. Add nginx for easy proxy setup.

About

Make development or deployment easier with docker


Languages

Language:Dockerfile 57.3%Language:Shell 31.4%Language:Makefile 11.2%