Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the docker-compose serving #694

Open
wants to merge 7 commits into
base: devel
Choose a base branch
from

Conversation

AlanCoding
Copy link
Member

This fixes a grab bag of problems for me, but still doesn't get it to usability. The static files makes this render.

Screenshot from 2025-02-05 15-04-56

And then the other changes address the errors in logs

dab_postgres  | 2025-02-05 18:39:53.062 UTC [58] FATAL:  role "$${POSTGRES_USER}" does not exist

and

test_app-1    | uwsgi_check_logrotate()/lseek(): Illegal seek [core/logging.c line 494]

This is addressed by the uwsgi config file change, and to the startup script.

I think this is some progress, but unfortunately, I'm still blocked on using the docker-compose environment as I get a CSRF error when trying to log in.

@@ -7,7 +7,7 @@ chmod-socket = 660
vacuum = true

# Log to stdout
logto = /dev/stdout
# logto = /dev/stdout
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seemed to cause the problem related to seeking, that it was logging to a file that didn't allow seeking (which was /dev/stdout). It still logged without this, and I think we weren't really getting uwsgi logs without it, maybe.

@AlanCoding AlanCoding marked this pull request as ready for review February 6, 2025 14:59
@@ -49,3 +49,6 @@ tools/generated/*

# generated ssl certs
compose/ingress/certs/*

# static files
test_app/static_collected/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I put this in /static/ first, but someone had already put 1 file in that folder. Using a different dir requires more settings to manage that but is then non-conflicting with this existing file. I tested it and things are working.

@@ -12,6 +12,7 @@ echo "settings.DATABASE ..."
$PYTHON manage.py shell -c 'from django.conf import settings; print(settings.DATABASES)'

$PYTHON manage.py migrate
$PYTHON manage.py collectstatic --clear --noinput
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --clear option would blow away the existing file in the test_app/static/ dir when I had it there, but using the new folder resolves this, so that'll only contain collected static files.

@AlanCoding AlanCoding changed the title Try and fix the docker-compose serving Fix the docker-compose serving Feb 6, 2025
Copy link

sonarqubecloud bot commented Feb 6, 2025

@tznamena
Copy link
Contributor

Can we get a list of the problems that are supposed to be fixed by this PR?

@AlanCoding
Copy link
Member Author

@tznamena

  • serving static files was not working, so templates were kind of functional but didn't have DRF styling
  • postgres health_check in docker-compose didn't work when running other services with it
  • The intent of the docker compose was to use from port 443 (IIRC), so https://localhost, but you couldn't log in from that URL, and this fixes that CRSF related error so you can log in

@john-westcott-iv
Copy link
Member

@AlanCoding since this is just dev environment we will let you all review and and merge it. If you need anything from platform services please let us know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants