-
-
Notifications
You must be signed in to change notification settings - Fork 968
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 #1817 docker dx #1828
base: main
Are you sure you want to change the base?
Fix #1817 docker dx #1828
Conversation
Tests currently still fail if The issue with those is that they use hardcoded domains, e.g. djangoproject.com/docs/tests.py Lines 377 to 385 in ff2fd01
Replacing the hardcoded values with something like the following makes them pass successfully: def test_sitemap_index(self):
response = self.client.get(
"/sitemap.xml", headers={"host": f"docs.{settings.PARENT_HOST}"}
)
self.assertContains(response, "<sitemap>", count=2)
self.assertContains(
response,
f"<loc>http://docs.{settings.PARENT_HOST}/sitemap-en.xml</loc>",
) If anyone has alternative solutions, let me know. |
ff3aaa3
to
9470ac4
Compare
5ed2117
to
09d7622
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the value in keeping the dependencies in Docker?
I see mixed changes in this PR (e.g. dockers, settings.PARENT_HOST, ...)
Can you provide seprataed PRs ?
Sorry, I should have added it to the description (which I have now updated). As mentioned in #1817 |
As per django#1817, tox is missing build dependencies and cannot run tests in containers. This commit added an argument to make purging packages optional, allowing to optimize image for deployment, while also keeping the required packages in dev environments.
Added 'tracdb' container to compose file. Simplified docker settings to remove duplication. Added support for 'secrets.json' in the docker dev stage. Added the 'DJANGOPROJECT_DATA_DIR' env var to tox.
b1f566e
to
65b2438
Compare
@pauloxnet how granular would you like the changes to be? I have removed the commit that fixes tests when |
I converted this back to a Draft for now, as we are working out smaller scope PRs. |
GitHub closed my previous PR (#1819) after I renamed a branch, so here is a new one.
Thanks to @tobiasmcnulty for pointing out a flaw in my previous implementation. This uses a build argument to determine when to remove packages, which allows removing them in the production build, but keeping them during local development which allows
tox
to buildpsycopg
successfully in docker.This also adds a container for the Trac database, which eliminates some errors upon startup, and makes tests pass in docker in most situations, and eliminates a lot of redundancy from the Docker settings file.
Fixes #1817