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

update to start up with docker-compose #330

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# unicef/etools-prp-base:latest
ARG BASE_TAG=installed
#ARG BASE_TAG=installed
ARG BASE_TAG=latest
FROM unicef/datamart:$BASE_TAG

ADD src /code/
Expand Down
65 changes: 43 additions & 22 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ x-datamart-defaults: &datamart_defaults
volumes:
- "$PWD:/code"
environment:
DEBUG: 1
DEBUG: 0
DATABASE_URL: postgis://postgres:@db:5432/etools_datamart
DATABASE_URL_ETOOLS: postgis://postgres:@db-etools:5432/etools
#NOTE: Please update ETOOLS DB server IP/name and port specific to your enviroment.
DATABASE_URL_ETOOLS: postgis://postgres:@192.168.244.151:5442/etools
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is your IP

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Provided instruction to update the settings for the enviroment.

DATABASE_URL_PRP: postgis://postgres:@db-prp:5432/prp
AUTOCREATE_USERS: "admin,123"
CACHE_URL: "redis://redis:6379/1"
Expand All @@ -30,16 +31,15 @@ x-datamart-defaults: &datamart_defaults
SESSION_COOKIE_SECURE: 0
STATIC_ROOT: /code/src/etools_datamart/apps/web/static/
GEOS_LIBRARY_PATH: "/usr/lib/libgeos_c.so.1"
GDAL_LIBRARY_PATH: "/usr/lib/libgdal.so.26"
GDAL_LIBRARY_PATH: "/usr/lib/libgdal.so"
EXPORT_FILE_STORAGE: "django.core.files.storage.FileSystemStorage"

services:
proxy:
image: traefik:v2.1
command: --api.insecure=True --providers.docker
ports:
- "8083:80"
- "8080:8080"
- "8084:8080"
container_name: datamart_proxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
Expand All @@ -57,42 +57,63 @@ services:
beat:
container_name: datamart_beat
<< : *datamart_defaults
command: celery -A etools_datamart beat --loglevel=info --workdir=/code/src
working_dir: /code/src
#command: celery beat etools_datamart --loglevel=info --workdir=/code/
#command: celery beat etools_datamart --loglevel=info
#command: celery -A etools_datamart beat --loglevel=debug
command: bash -c "celery -A etools_datamart beat --loglevel=info"
#command: celery -A etools_datamart beat --loglevel=debug --workdir /code
environment:
- BACKEND_DEBUG=False
- DJANGO_SETTINGS_MODULE='etools_datamart.config.settings'

worker:
container_name: datamart_worker
<< : *datamart_defaults
command: celery -A etools_datamart worker --loglevel=info --workdir=/code/src

working_dir: /code/src
#command: celery worker etools_datamart --loglevel=info --workdir=/code/
#command: celery worker etools_datamart --loglevel=info
#command: celery -A etools_datamart worker --loglevel=debug
command: celery -A etools_datamart.celery worker --loglevel=info
#command: find . -name celery.py -print
#command: ['celery', 'worker, '-A', 'etools_datamart', '-l', 'info']
environment:
- BACKEND_DEBUG=True
- DJANGO_SETTINGS_MODULE='etools_datamart.config.settings'

db:
image: postgis/postgis:12-3.2
container_name: datamart_db
ports:
- "15432:5432"
environment:
POSTGRES_PASSWORD:
POSTGRES_USER: postgres
POSTGRES_HOST_AUTH_METHOD: trust
#POSTGRES_PASSWORD:
#POSTGRES_USER: postgres
POSTGRES_DB: etools_datamart
volumes:
- "$PWD/build/db:/var/lib/postgresql/data"

# Rely on etools and prp database instances running locally
db-etools:
image: postgis/postgis:12-3.2
container_name: datamart_etools
shm_size: '1gb'
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD:
POSTGRES_DB: etools
volumes:
- "$PWD/build/etools:/var/lib/postgresql/data"
#db-etools:
# image: postgis/postgis:12-3.2
# container_name: datamart_etools
# shm_size: '1gb'
# environment:
# POSTGRES_USER: postgres
# POSTGRES_PASSWORD:
# POSTGRES_DB: etools
# volumes:
# - "$PWD/build/etools:/var/lib/postgresql/data"

db-prp:
image: postgis/postgis:12-3.2
shm_size: '1gb'
container_name: datamart_prp
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD:
POSTGRES_HOST_AUTH_METHOD: trust
#POSTGRES_USER: postgres
#POSTGRES_PASSWORD:
POSTGRES_DB: prp
volumes:
- "$PWD/build/prp:/var/lib/postgresql/data"
Expand Down