Create docker-compose-aws.yml for local testing #674#685
Open
drakeredwind01 wants to merge 7 commits into
Open
Create docker-compose-aws.yml for local testing #674#685drakeredwind01 wants to merge 7 commits into
drakeredwind01 wants to merge 7 commits into
Conversation
…and entrypoint-aws.sh #672
Single-stage: 74MB → multi-stage: 60.7MB (18% reduction)
for more information, see https://pre-commit.ci
| @@ -0,0 +1,37 @@ | |||
| from .settings import * # noqa: F401, F403 | |||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #674
Create docker-compose-aws.yml for local testing #674
Pre-implementation concerns
1. Must NOT mount the app directory as a volume
Dev compose mounts
./app/:/usr/src/app/for live editing.docker-compose-aws.ymlmust NOT do this — app code is baked into the image. Mounting would overwrite it with live local code, bypassingcollectstatic, the multi-stage build, andsettings_aws.py— nothing production-like would actually be tested.2. Need a new
.env.docker-awsfile.env.dockerhasDEBUG=True— wrong for production testing..env.prod.samplehasSECURE_SSL_REDIRECT=True— causes an infinite redirect loop locally without SSL.Fix: created
app/.env.docker-aws-examplewithDEBUG=False, SSL settings off, and local-friendlyDJANGO_ALLOWED_HOSTS. Copy toapp/.env.docker-awsto use (gitignored).3. Port conflict with dev compose
Dev compose binds host ports 8000/5432. AWS compose uses
8001:8000and5433:5432so both stacks can run simultaneously.4. Postgres named volume must differ from dev
Dev uses
postgres_data. AWS usespostgres_data_awsto avoid shared database state and migration conflicts.5.
.env.docker-awsnot covered by.gitignoreAdded
.env.docker-awsto.gitignoreso secrets are never committed.Files created:
docker-compose-aws.yml— builds Dockerfile-aws, ports 8001:8000 and 5433:5432, postgres_data_aws volume, no code volume mountapp/.env.docker-aws-example— production-like env template: DEBUG=False, SSL off, local ALLOWED_HOSTSdocs/contributing/howto/test-aws-setup-locally.md— full guide: setup steps, cleanup commands, comparison table of dev vs aws environmentsdocs/contributing/onboarding/test_aws_locally.md— two commands and a link to the full guideFiles updated:
.gitignore— added.env.docker-awsdocs/contributing/howto/index.md— added link to new guideCloses #219