Skip to content

Conversation

@jadudm
Copy link
Contributor

@jadudm jadudm commented Jan 29, 2026

JIRA Ticket:

https://jira.cms.gov/browse/BB2-4424

What Does This PR Do?

We are moving to Fargate. Fargate has a read-only filesystem; therefore, we need to be confident that the Blue Button application does not (quietly or loudly) expect to be able to write to the local disk.

This PR makes a few changes to better simulate these conditions locally:

CSS assets statically built

Inside of the container, we now build the CSS static assets. This is hard to observe, though, because those assets are built inside of the /code/static path. We then, in our compose file, mount /code from the local filesystem as a bind volume. This then shadows the path in the image (which contains our assets).

There are two ways we could resolve this:

  1. Mount volumes differently. We could mount ../apps at /code/apps, and that would then limit the amount of code we are shadowing. The static assets in the image would then be used.
  2. Build dist locally, and use that.

I've added both the build internal to the image (and tested it by not mounting /code) as well as added to our local build the generation of dist in static/bluebutton-css. Or: option 2 was chosen in this PR, and it is possible to instead use option. PR discussion welcome.

An environment variable was added for WRITEABLE_ROOT

This is a breaking change, and should be reverted. Given that we don't actually write to the local FS (and instead write to S3) in production, this change would impact our deployed app in negative ways. I'll update the PR while it is in draft to remove this exploration.

What Should Reviewers Watch For?

  1. Comment out the mounting of /code as a mounted filesystem.
  2. Run the stack (make run-local)
  3. Run all unit/selenium tests

There should be no errors.

Validation

See above.

What Security Implications Does This PR Have?

No security implications.

Any Migrations?

No migrations.

This does several things:

* Adds DJANGO_WRITEABLE_ROOT to our environment variables. This is where we are allowed to write data.
* Mounts /media as our writeable `tempfs`
* Explicitly makes everything else non-writeable.

All unit tests and selenium tests should pass.

It should be possible to upload an image for an app (existing or new).

If you log into the container, it should be possible to

```
touch /media/test.txt
```

and it should fail if you try and

```
touch /code/test.txt
```
Again, this is simulating production-like conditions for Fargate.
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