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 docker-compose setup #711

Closed
wants to merge 6 commits into from
Closed

Fix docker-compose setup #711

wants to merge 6 commits into from

Conversation

akirabaruah
Copy link
Contributor

The docker-compose workflow seems broken without these updates.

@akirabaruah akirabaruah changed the title Update Python packages Fix docker-compose setup Dec 21, 2023
@@ -155,6 +155,10 @@
]
STATICFILES_STORAGE = "whitenoise.django.CompressedManifestStaticFilesStorage"

# TODO: Fix the missing manifest issues. This is a workaround.
# https://github.com/cardinalitypuzzles/cardboard/issues/712
WHITENOISE_MANIFEST_STRICT = False
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should probably just leave this alone, the collectstatic change should almost certainly fix this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Unfortunately, if I remove this, I still see the ValueError: Missing staticfiles manifest entry for 'favicon.ico' message at run time. So I think there's a couple layers to this problem:

  1. Actually generating static files and associated paths, which was covered by collectstatic.
  2. Configuring the manifest correctly. I'm not sure how to debug that bit, but turning off WHITENOISE_MANIFEST_STRICT does seem to workaround it until we properly fix it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

To unblock devs, I think we should submit this workaround, but then try to fix the manifest issue ASAP. I'm happy to keep digging into it for #712 (can add it to MITMH 2024 milestone and assign myself), unless you have other ideas.

Copy link
Contributor

Choose a reason for hiding this comment

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

well I think the problem is that you need to run collectstatic on your machine. If you're saying that the docker change doesn't actually fix that for you, then we should undo the docker change, although I'm surprised that isn't enough--did you restart the container?

In any case, when the container is running, you can also run docker-compose exec web python manage.py collectstatic to run collectstatic manually

Copy link
Contributor Author

@akirabaruah akirabaruah Dec 21, 2023

Choose a reason for hiding this comment

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

well I think the problem is that you need to run collectstatic on your machine.

I'm fairly certain that this is only half of the problem (item 1 in my comment earlier).

If you're saying that the docker change doesn't actually fix that for you, then we should undo the docker change, although I'm surprised that isn't enough--did you restart the container?

I tested each change in isolation (making sure to stop, prune, and restart containers each time) and found that we need both changes to avoid the issue.

But in any case, it looks like @kcaze found the proper fix for item 2 in #715, so we can close this PR and merge that one.

@akirabaruah
Copy link
Contributor Author

See #715

@akirabaruah akirabaruah deleted the broken-docker branch January 10, 2024 19:26
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.

2 participants