Public | Automated Build

Last pushed: 2 years ago
Short Description
Django base image. Process managed by circus. Config with envtpl. Based on apsl/circusbase.
Full Description

========================

Docker django base image

Docker base image for python (currently 2.7) django projects.
Multi-process container, managed by circusd.
Django config managed with env vars.

Other configuration managed with envtpl (nginx, circusd).

Description

Docker image intended for use as a base image for django apps

Ports

Env vars:

Run web worker (default True)::

-e RUN_WEB=True    

Run celery worker (default False)::

-e RUN_CELERY=false    

Celery worker concurrency. If not defined, uses num of cpus.

-e CELERY_WORKER_CONCURRENCY=4

Celery beat

-e RUN_CELERYBEAT=False

Celery beat scheduler type: file or class (default file)::

-e CELERYBEAT_SCHEDULE_TYPE=file

Celery beat scheduler file. (default /code/src/celerybeat-schedule)::

-e CELERYBEAT_SCHEDULE_FILE=/code/src/celerybeat-schedule

Celery beat scheduler class. (default djcelery.schedulers.DatabaseScheduler)::

-e CELERYBEAT_SCHEDULE_CLASS=djcelery.schedulers.DatabaseScheduler

Celery Flower.

-e RUN_FLOWER=False

Flower basic auth. If not defined, no auth

-e FLOWER_BASIC_AUTH=myuser:mypasswd

Flower Oauth. If defined:

-e FLOWER_AUTH=.*@apsl.net

... And all your django standar settings.

Example django Dockerfile based on apsl/django:

FROM apsl/django

# requirements
ADD requirements.txt /tmp/requirements.txt
RUN su -c "pew-in env pip install -r /tmp/requirements.txt" django

# add code
ADD src /code/src
RUN chown django.django /code/src -R

# collectstatic
RUN su -c "pew-in env python manage.py collectstatic --noinput" django
Docker Pull Command
Owner
apsl
Source Repository