Skip to content

Create docker-compose-aws.yml for local testing #674#685

Open
drakeredwind01 wants to merge 7 commits into
mainfrom
drake_674_docker_compose_aws
Open

Create docker-compose-aws.yml for local testing #674#685
drakeredwind01 wants to merge 7 commits into
mainfrom
drake_674_docker_compose_aws

Conversation

@drakeredwind01

@drakeredwind01 drakeredwind01 commented Jun 12, 2026

Copy link
Copy Markdown
Member

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.yml must NOT do this — app code is baked into the image. Mounting would overwrite it with live local code, bypassing collectstatic, the multi-stage build, and settings_aws.py — nothing production-like would actually be tested.

2. Need a new .env.docker-aws file
.env.docker has DEBUG=True — wrong for production testing. .env.prod.sample has SECURE_SSL_REDIRECT=True — causes an infinite redirect loop locally without SSL.
Fix: created app/.env.docker-aws-example with DEBUG=False, SSL settings off, and local-friendly DJANGO_ALLOWED_HOSTS. Copy to app/.env.docker-aws to use (gitignored).

3. Port conflict with dev compose
Dev compose binds host ports 8000/5432. AWS compose uses 8001:8000 and 5433:5432 so both stacks can run simultaneously.

4. Postgres named volume must differ from dev
Dev uses postgres_data. AWS uses postgres_data_aws to avoid shared database state and migration conflicts.

5. .env.docker-aws not covered by .gitignore
Added .env.docker-aws to .gitignore so 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 mount
  • app/.env.docker-aws-example — production-like env template: DEBUG=False, SSL off, local ALLOWED_HOSTS
  • docs/contributing/howto/test-aws-setup-locally.md — full guide: setup steps, cleanup commands, comparison table of dev vs aws environments
  • docs/contributing/onboarding/test_aws_locally.md — two commands and a link to the full guide

Files updated:

  • .gitignore — added .env.docker-aws
  • docs/contributing/howto/index.md — added link to new guide

Closes #219

@@ -0,0 +1,37 @@
from .settings import * # noqa: F401, F403
@drakeredwind01 drakeredwind01 requested a review from fyliu June 12, 2026 02:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Create docker-compose-aws.yml for local testing Create deployment docker setup (for dev env)

1 participant