Skip to content

Commit

Permalink
fix: redo changes that somehow got reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
JasonLovesDoggo committed Jan 11, 2025
1 parent e136193 commit 35a289f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 66 deletions.
18 changes: 0 additions & 18 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ services:
image: "valkey/valkey:7.2-alpine"
restart: always

postgres:
image: postgres:16-alpine
shm_size: 128mb
volumes:
- ../postgres:/var/lib/postgresql/data/
- ${PWD}/scripts/postgres-init-db.sh:/docker-entrypoint-initdb.d/postgres-init-db.sh
env_file: .env
environment:
POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}"
POSTGRES_USER: "hackathons_canada_superuser"
POSTGRES_DB: "hackathons"
restart: always
healthcheck:
test: ["CMD", "pg_isready -U ${POSTGRES_USER}", "-d", "${POSTGRES_DB}"]
interval: 5s
timeout: 20s
retries: 5

celery_worker:
build:
context: .
Expand Down
2 changes: 1 addition & 1 deletion docs/internal/migrations/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,4 @@ python manage.py migrate socialaccount zero

# Step 4: Reapply migrations
python manage.py migrate
```
```
2 changes: 1 addition & 1 deletion scripts/django/start
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ set -o nounset
python manage.py migrate --no-input
python manage.py collectstatic --no-input

gunicorn -w 1 --bind 0.0.0.0:22300 hackathons_canada.wsgi:application
gunicorn -w 2 --bind 0.0.0.0:22300 hackathons_canada.wsgi:application
54 changes: 27 additions & 27 deletions scripts/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,32 +8,32 @@ set -o pipefail
set -o nounset
source /opt/pysetup/.venv/bin/activate



postgres_ready() {
/opt/pysetup/.venv/bin/python << END
import sys
import psycopg
try:
psycopg.connect(
dbname="${POSTGRES_DB}",
user="${POSTGRES_USER}",
password="${POSTGRES_PASSWORD}",
host="${POSTGRES_HOST}",
port="${POSTGRES_PORT}",
)
except psycopg.OperationalError:
sys.exit(-1)
sys.exit(0)
END
}
until postgres_ready; do
>&2 echo 'Waiting for PostgreSQL to become available...'
sleep 1
done
>&2 echo 'PostgreSQL is available'
#
#
#postgres_ready() {
#/opt/pysetup/.venv/bin/python << END
#import sys
#
#import psycopg
#
#try:
# psycopg.connect(
# dbname="${POSTGRES_DB}",
# user="${POSTGRES_USER}",
# password="${POSTGRES_PASSWORD}",
# host="${POSTGRES_HOST}",
# port="${POSTGRES_PORT}",
# )
#except psycopg.OperationalError:
# sys.exit(-1)
#sys.exit(0)
#
#END
#}
#until postgres_ready; do
# >&2 echo 'Waiting for PostgreSQL to become available...'
# sleep 1
#done
#>&2 echo 'PostgreSQL is available'

exec "$@"
19 changes: 0 additions & 19 deletions scripts/postgres-init-db.sh

This file was deleted.

0 comments on commit 35a289f

Please sign in to comment.