Make Docker production containers compatible with NERSC Spin#68
Merged
tomvothecoder merged 26 commits intoE3SM-Project:mainfrom Jan 13, 2026
Merged
Make Docker production containers compatible with NERSC Spin#68tomvothecoder merged 26 commits intoE3SM-Project:mainfrom
tomvothecoder merged 26 commits intoE3SM-Project:mainfrom
Conversation
4b55de9 to
0f57264
Compare
0f57264 to
5007aa4
Compare
There was a problem hiding this comment.
Pull request overview
This PR refactors SimBoard's Docker infrastructure to support deployment on NERSC Spin by simplifying the environment management system from multiple environments (dev/dev_docker/prod) to a cleaner local/production split, removing Traefik dependencies, and enabling the backend to accept OS-level environment variables.
Key changes:
- Consolidated environment configuration from
.envs/{dev,dev_docker,prod}/to.envs/{example,local}/with cleaner separation between templates and developer-specific values - Updated backend configuration to load env files only in development mode (ENV=development), relying on OS environment variables in production
- Removed non-root user from backend container to accommodate NERSC Spin's volume permission model
- Simplified frontend API configuration to use relative paths in production and configurable origins in development
- Removed Traefik from docker-compose.yml and consolidated Docker development setup into docker-compose.local.yml
- Updated certificate naming from
dev.key/dev.crttolocal.key/local.crtfor clarity - Reorganized Makefile commands to remove env parameter complexity
Reviewed changes
Copilot reviewed 24 out of 27 changed files in this pull request and generated 16 comments.
Show a summary per file
| File | Description |
|---|---|
| frontend/vite.config.ts | Refactored to load env files only in development mode; simplified cert path handling |
| frontend/src/api/api.ts | Changed API URL construction to use relative paths in production, absolute in dev |
| frontend/package.json | Removed TypeScript compilation from build script |
| frontend/nginx.conf | Added backend route blocking; improved SPA fallback logic |
| frontend/nginx-backend-not-found.conf | Removed (consolidated into nginx.conf) |
| frontend/Dockerfile | Removed VITE_API_URL build arg; removed separate nginx-backend-not-found.conf copy; removed security upgrade |
| backend/app/core/config.py | Simplified env file loading to check ENV variable instead of CI/APP_ENV |
| backend/tests/core/test_config.py | Updated tests for new ENV-based logic and directory structure |
| backend/Dockerfile | Changed to non-editable wheel installation; removed non-root user setup |
| docker-compose.yml | Removed Traefik, simplified to backend/frontend services with env variable support |
| docker-compose.local.yml | New file for local PostgreSQL service only |
| docker-compose.dev.yml | Removed (no longer needed) |
| Makefile | Removed env parameter; consolidated commands; updated to use docker-compose.local.yml |
| README.md | Updated cert paths; added NERSC Spin build instructions; updated directory structure docs |
| .gitignore | Updated cert script name reference |
| .github/workflows/backend-ci.yml | Removed CI and APP_ENV variables (now uses ENV=test) |
| certs/generate-local-certs.sh | Renamed from generate-dev-certs.sh; updated output filenames |
| .envs/ structure | Reorganized to example/ (templates) and local/ (gitignored developer values) |
Comments suppressed due to low confidence (1)
.envs/example/backend.production.env.example:18
- The production env file example includes 'CI=true' which forces the config to skip loading the env file. This is confusing as it contradicts the purpose of the file. Either remove this line or add a clear comment explaining that this is only needed when running locally with production-mode docker-compose to simulate the CI environment behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Description
Steps to Complete
Environment Files
/examples/localsetup-env-filescommand with appropriate changesDocker Files
dbservice indocker-compose.local.ymldev_dockerenv filesBackend
appusersetuprootownership of app data on SpinFrontend
node_modulesmounting for hot reloadnode_modulesis referenced on Spin (requires volume mount, which is unnecessary)locationblocks insideserver{...}Checklist
Deployment Notes (if any)
01/08/26
simboard.e3sm.orgFollow-up Tasks