Skip to content

Commit

Permalink
Merge pull request #2654 from onaio/use-docker-compose-for-local-dev
Browse files Browse the repository at this point in the history
Update docker compose file and make it ready for local dev
  • Loading branch information
FrankApiyo authored Aug 24, 2024
2 parents fea517d + 21c33b9 commit 8789e82
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
15 changes: 13 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
services:
api:
environment:
DJANGO_SETTINGS_MODULE: onadata.settings.docker
build:
context: .
args:
INSTALL_DEV_DEPENDENCIES: "true"
dockerfile: ./docker/onadata-uwsgi/Dockerfile.ubuntu
depends_on:
- database
Expand All @@ -10,20 +14,26 @@ services:
tty: true
volumes:
- ./:/srv/onadata
- savreaderwriter-exclusion:/srv/onadata/src/savreaderwriter
ports:
- 8000:8000
command: python3.10 manage.py runserver --settings=onadata.settings.docker
- "8000:8000"
command: python3.10 manage.py runserver 0.0.0.0:8000

celery:
environment:
DJANGO_SETTINGS_MODULE: onadata.settings.docker
build:
context: .
args:
INSTALL_DEV_DEPENDENCIES: "true"
dockerfile: ./docker/onadata-uwsgi/Dockerfile.ubuntu
depends_on:
- database
- cache
- api
volumes:
- ./:/srv/onadata
- savreaderwriter-exclusion:/srv/onadata/src/savreaderwriter
command: celery -A onadata.celeryapp worker -B -l INFO -E

database:
Expand All @@ -39,4 +49,5 @@ services:
image: redis:alpine

volumes:
savreaderwriter-exclusion:
dbdata:
5 changes: 5 additions & 0 deletions docker/onadata-uwsgi/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ RUN python -m pip install --no-cache-dir -U pip && \
python -m pip install --no-cache-dir -r requirements/azure.pip && \
python -m pip install --no-cache-dir pyyaml==6.0.1 uwsgitop==0.12 supervisor==4.2.5

ARG INSTALL_DEV_DEPENDENCIES=false
RUN if [ "$INSTALL_DEV_DEPENDENCIES" = "true" ]; then \
python -m pip install --no-cache-dir -r requirements/dev.pip; \
fi

FROM base AS docs

ENV PYENV_ROOT="$HOME/.pyenv"
Expand Down

0 comments on commit 8789e82

Please sign in to comment.