Compare commits
5 Commits
03fcbdb5ad
...
fix/prod-s
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c9dab3e93b
|
||
|
|
349f1db721
|
||
| de56b564c5 | |||
|
|
833ff378ea
|
||
|
|
754b0ca5f6
|
@@ -23,7 +23,7 @@ sudo systemctl restart sum-nohype
|
||||
|
||||
echo "==> Waiting for health check"
|
||||
for i in $(seq 1 30); do
|
||||
if curl -fsS http://localhost:8001/ >/dev/null 2>&1; then
|
||||
if curl -fsS -H "Host: nohypeai.net" http://localhost:8001/ >/dev/null 2>&1; then
|
||||
echo "==> Site is up"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
22
deploy/entrypoint.prod.sh
Executable file
22
deploy/entrypoint.prod.sh
Executable file
@@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
python manage.py tailwind install --no-input
|
||||
python manage.py tailwind build
|
||||
python manage.py migrate --noinput
|
||||
python manage.py collectstatic --noinput
|
||||
|
||||
# Set Wagtail site hostname from first entry in ALLOWED_HOSTS
|
||||
python manage.py shell -c "
|
||||
from wagtail.models import Site
|
||||
import os
|
||||
hostname = os.environ.get('ALLOWED_HOSTS', 'localhost').split(',')[0].strip()
|
||||
Site.objects.update(hostname=hostname, port=443, site_name='No Hype AI')
|
||||
"
|
||||
|
||||
exec gunicorn config.wsgi:application \
|
||||
--workers 3 \
|
||||
--bind 0.0.0.0:8000 \
|
||||
--access-logfile - \
|
||||
--error-logfile - \
|
||||
--capture-output
|
||||
@@ -1,18 +1,8 @@
|
||||
services:
|
||||
web:
|
||||
build: .
|
||||
build: app
|
||||
working_dir: /app
|
||||
command: >
|
||||
sh -c "python manage.py tailwind install --no-input &&
|
||||
python manage.py tailwind build &&
|
||||
python manage.py migrate --noinput &&
|
||||
python manage.py collectstatic --noinput &&
|
||||
gunicorn config.wsgi:application
|
||||
--workers 3
|
||||
--bind 0.0.0.0:8000
|
||||
--access-logfile -
|
||||
--error-logfile -
|
||||
--capture-output"
|
||||
command: /app/deploy/entrypoint.prod.sh
|
||||
env_file: .env
|
||||
environment:
|
||||
DJANGO_SETTINGS_MODULE: config.settings.production
|
||||
|
||||
Reference in New Issue
Block a user