Skip to content

Commit 8de9b4a

Browse files
committed
fix healthchecks
1 parent 07fad41 commit 8de9b4a

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

samples/django-channels-redis/app/django_defang/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def get_private_ips():
4141
return [] # or return a default list of IPs
4242

4343
ALLOWED_HOSTS = [
44-
'*.prod1.defang.dev',
44+
'.prod1.defang.dev',
45+
'localhost',
4546
] # Add your own domain name
4647

4748
ALLOWED_HOSTS += get_private_ips() # Add private IPs so the health check can pass

samples/django-channels-redis/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ services:
1616
healthcheck:
1717
# wget or curl required for healthchecks on services with a published port
1818
# this gets parsed by Defang and provided to the load balancers as well
19-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:8000/"]
19+
test: ["CMD", "python3", "-c", "import sys, urllib.request; urllib.request.urlopen(sys.argv[1]).read()", "http://localhost:8000/"]
2020

2121
redis_service:
2222
image: redis:6.2

starter-sample/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ services:
1616
healthcheck:
1717
# wget or curl required for healthchecks on services with a published port
1818
# this gets parsed by Defang and provided to the load balancers as well
19-
test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/"]
19+
test: ["CMD", "curl", "-f", "http://localhost:3000/api/health" ]

0 commit comments

Comments
 (0)