Set up development environment (fix Docker build, pin LocalStack, add AGENTS.md)#3
Draft
whummer wants to merge 3 commits into
Draft
Set up development environment (fix Docker build, pin LocalStack, add AGENTS.md)#3whummer wants to merge 3 commits into
whummer wants to merge 3 commits into
Conversation
Pin Poetry to 1.1.15 (matching poetry.lock's lock-version 1.1) and pre-install cryptography 2.8 so Poetry's keyring dep does not pull a Rust/setuptools>=77 build. Install into the system interpreter (virtualenvs.create=false) to avoid the seeded venv's too-new setuptools breaking the 2020-era sdist builds, and add /home/app/.local/bin to PATH so poetry run flask/celery/uwsgi resolve. Co-authored-by: Waldemar Hummer <whummer@users.noreply.github.com>
The unpinned localstack/localstack tag now resolves to a build that requires a paid LOCALSTACK_AUTH_TOKEN and exits (code 55) without one, breaking the /files S3 demo flow. Co-authored-by: Waldemar Hummer <whummer@users.noreply.github.com>
Co-authored-by: Waldemar Hummer <whummer@users.noreply.github.com>
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.
Summary
Sets up a working development environment for this Flask + Celery + Postgres + Redis + LocalStack template. The documented dev workflow (
make develop/ Docker Compose) no longer builds or runs on today's registries because of unpinned, drifted dependencies. This PR makes the environment reproducible with minimal, well-commented dependency pins and addsAGENTS.mdwith cloud-specific run instructions. No application code was changed.Changes
Dockerfile— make the image build on thepython:3.8-alpine3.11base:1.1.15(matchespoetry.locklock-version 1.1; avoids modern Poetry'srapidfuzzsource build on musl).cryptography==2.8so Poetry'skeyring/SecretStoragedep doesn't pull the latest cryptography (needs Rust +setuptools>=77, impossible on py3.8).poetry config virtualenvs.create false— install into the system interpreter (the venv Poetry seeds ships a setuptools too new to build the 2020-erapsycopg2/uwsgi/SQLAlchemy-Utilssdists)./home/app/.local/bintoPATHsopoetry run flask/celery/uwsgiresolve.docker-compose.yaml— pinlocalstack/localstack:3.8.1. The unpinned/latesttag now requires a paidLOCALSTACK_AUTH_TOKENand exits (code 55) without one, breaking the/filesS3 flow.AGENTS.md— new; Cursor Cloud specific instructions (startdockerdmanually, usesudo -E docker compose,DEV=truefor the dev server, bring-up sequence, the/filesbucket-order gotcha, and the dependency-pin rationale).Verification
All five services build and run via Docker Compose (
DEV=true), migrations apply, and both core flows work end to end:/increments a Postgres-backed counter (also driven by the Celery Beatdo_somethingheartbeat every 5s: 513 → 524).GET /filescreatestest-bucketand lists it;GET /files/createuploads objects; listing then shows the uploaded objects.flask_localstack_demo.mp4
Counter page:
Counter page
LocalStack S3
/filesJSON listing with uploaded objects:S3 files listing
DEV=true sudo -E docker compose build... docker compose run --rm worker poetry run flask db upgradeDEV=true sudo -E docker compose up -d... docker compose run --rm worker poetry run pytest(pytest 5.4.1 installed; template ships no tests)To show artifacts inline, enable in settings.