Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single compose base #352

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ log/
backups/
secrets/
build
docker-compose.yml
.transifexrc
.idea/*
*.override.yml
Expand Down
88 changes: 88 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
x-environment: &default-environment
PUBLIC_REQUEST_SCHEME: http
INTERNAL_DOMAIN_NAME: kobo.local
PUBLIC_DOMAIN_NAME: kobo.local
KOBOCAT_URL: http://kc.kobo.local
KOBOCAT_INTERNAL_URL: http://kobocat:8000
KOBOFORM_PUBLIC_SUBDOMAIN: kf
KOBOCAT_PUBLIC_SUBDOMAIN: kc
ENKETO_REDIS_MAIN_URL: redis://redis:6379
services:
postgres:
image: postgis/postgis
environment:
POSTGRES_HOST_AUTH_METHOD: trust
networks:
- kobo-be-network
mongo:
image: mongo
networks:
- kobo-be-network
redis:
image: redis
networks:
- kobo-be-network
kpi: &django
image: kobotoolbox/kpi:2.024.33c
environment:
<<: *default-environment
DJANGO_DEBUG: "true" # Remove?
USE_X_FORWARDED_HOST: "true"
PYTHONUNBUFFERED: 1 # Move to Dockerfile?
DATABASE_URL: postgis://postgres:postgres@postgres:5432/postgres
KC_DATABASE_URL: postgis://postgres:postgres@postgres:5432/kobocat
SESSION_COOKIE_DOMAIN: .kobo.local
REDIS_SESSION_URL: redis://redis:6379
CELERY_BROKER_URL: redis://redis:6379
CACHE_URL: redis://redis:6379
SERVICE_ACCOUNT_BACKEND_URL: redis://redis:6379
ENKETO_URL: http://ee.kobo.local
command: ./manage.py runserver 0:8000
volumes:
- ./.vols/static/kpi:/srv/src/kpi/staticfiles
networks:
kobo-fe-network:
aliases:
- kobocat
kobo-be-network: {}
worker:
<<: *django
command: celery -A kobo worker -l info -s /tmp/celerybeat-schedule --pool threads -Q kpi_low_priority_queue,kpi_queue,kobocat_queue
nginx:
image: nginx
environment:
<<: *default-environment
TEMPLATED_VAR_REFS: "$${PUBLIC_REQUEST_SCHEME} $${INTERNAL_DOMAIN_NAME} $${PUBLIC_DOMAIN_NAME} $${KOBOFORM_PUBLIC_SUBDOMAIN} $${KOBOCAT_PUBLIC_SUBDOMAIN} $${ENKETO_EXPRESS_PUBLIC_SUBDOMAIN}"
networks:
kobo-fe-network:
aliases:
- kf.kobo.local
- kc.kobo.local
- ee.kobo.local
ports:
- 80:80
volumes:
- ./.vols/static:/srv/www:ro
- ./.vols/kobocat_media_uploads:/media
- ./.vols/kpi_media/__public:/srv/kpi_media/__public:ro
- ./nginx/docker-entrypoint.d/30-init-kobo-nginx.sh:/docker-entrypoint.d/30-init-kobo-nginx.sh
- ./nginx/kobo-docker-scripts/:/kobo-docker-scripts
enketo_express:
image: kobotoolbox/enketo-express-extra-widgets:6.2.2
init: true
environment:
<<: *default-environment
ENKETO_REDIS_CACHE_URL: "redis://redis:6379"
ENKETO_MAX_PROCESSES: 1
ENKETO_LINKED_FORM_AND_DATA_SERVER_SERVER_URL: ""
ENKETO_LINKED_FORM_AND_DATA_SERVER_AUTHENTICATION_ALLOW_INSECURE_TRANSPORT: "true"
command: node app.js
networks:
- kobo-fe-network
- kobo-be-network

networks:
kobo-fe-network:
driver: bridge
kobo-be-network:
driver: bridge