Skip to content

Commit

Permalink
merged with origin/refactor/001-change-endpoints-from-sync-to-async a…
Browse files Browse the repository at this point in the history
…nd upgraded packages in dockerfiles to the new version
  • Loading branch information
sepehr toof authored and sepehr toof committed Jun 29, 2024
1 parent b96371d commit e1d581c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Backend/user_management/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ RUN chown -R postgres:postgres /etc/supervisor && \

USER postgres

HEALTHCHECK --interval=30s --timeout=2s --start-period=5s --retries=3 CMD curl -sSf http://localhost:8000/user/register/ > /dev/null && echo "success" || echo "failure"
HEALTHCHECK --interval=30s --timeout=2s --start-period=5s --retries=3 CMD curl -sSf http://localhost:8001/user/register/ > /dev/null && echo "success" || echo "failure"

ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]
2 changes: 1 addition & 1 deletion Backend/user_management/run_consumer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# URL of the Django application
DJANGO_URL="http://user-service:8001/user/register/"
DJANGO_URL="http://localhost:8001/user/register/"

# Wait until Django server is available
while ! curl -s "${DJANGO_URL}" >/dev/null; do
Expand Down
4 changes: 2 additions & 2 deletions Backend/user_management/tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ python3 /app/user_management/manage.py makemigrations users
python3 /app/user_management/manage.py migrate
echo "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('${DB_USER}', '[email protected]', '${DB_USER}')" | python3 /app/user_management/manage.py shell && echo "Superuser created successfully."
# python3 /app/user_management/manage.py runserver 0.0.0.0:8001
cd app/user_management
daphne -b 0.0.0.0 -p 8000 user_management.asgi:application
cd /app/user_management
daphne -b 0.0.0.0 -p 8001 user_management.asgi:application
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
'127.0.0.1',
'[::1]',
'user-service',
'user-service:8000',
'user-service:8001',
]


Expand Down
8 changes: 4 additions & 4 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ services:
dockerfile: Backend/user_management/Dockerfile
env_file:
- .env
ports:
- 8001:8001
# ports:
# - 8001:8001
networks:
- transcendence_network
depends_on:
Expand All @@ -41,8 +41,8 @@ services:
dockerfile: Backend/auth_service/Dockerfile
env_file:
- .env
ports:
- 8000:8000
# ports:
# - 8000:8000
networks:
- transcendence_network
depends_on:
Expand Down

0 comments on commit e1d581c

Please sign in to comment.