Skip to content

Commit

Permalink
Ref #222 - Add test command and wait_for_db feature to dockerfile
Browse files Browse the repository at this point in the history
- Add testing command to run tests before starting application
- Add wait_for_db script for backend service to wait until database is ready
  • Loading branch information
Kerem Zaman committed Dec 12, 2021
1 parent 5bb8b57 commit 1643a05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion backend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ RUN pip install -r requirements.txt
ADD . /
WORKDIR /

CMD python manage.py makemigrations authentication && python manage.py makemigrations eventposts && python manage.py migrate && python manage.py runserver 0.0.0.0:9000
## POSTGRES WAIT SCRIPT FROM https://github.com/ufoscout/docker-compose-wait
ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.9.0/wait /wait
RUN chmod +x /wait
CMD /wait && python manage.py makemigrations authentication && python manage.py makemigrations eventposts && python manage.py migrate && python manage.py test eventposts && python manage.py runserver 0.0.0.0:9000

EXPOSE 9000

0 comments on commit 1643a05

Please sign in to comment.