-
Notifications
You must be signed in to change notification settings - Fork 53
Docker and docker compose development
If you are using a Mac with an M1 chip, this setup will not work, as first noticed on 07/13/2022. When trying to start the frontend
, backend
, and Nginx
containers, it will throw a Function not implemented
error. However, the database
container will still work.
For ease of local setup, we have created a docker compose setup, which builds docker images for all the necessary components. It also uses Nginx and mkcert to host the app locally over HTTPS. This setup more closely replicates the code deployed to production and is preferred for testing code in production. DevOps engineers prefer this setup.
- Install docker and docker compose.
- Install mkcert
- Install Node.js 18 using nvm or your preferred method. This is used for yarn scripts and pre-commit hooks.
- Install AdoptOpenJDK 17 using jabba or your preferred method. This is useful for IDE integration (IntelliJ, VS Code, etc.)
- Install yarn by running
npm install --global yarn
.
- Clone this repository:
git clone [email protected]:CDCgov/prime-simplereport.git
- Run
yarn install
in the root of the repository to install pre-commit hooks using lefthook - Run
cp .env.sample .env
in the repository's root, then obtain the needed secrets from Azure or another developer. Be sure to set theOKTA_API_KEY
environment variable. You can generate an API token for yourself by logging into the Okta Preview admin panel and going into Security > API > Tokens. - Run
sudo vim /etc/hosts
(or use your editor of choice) and add a line to the bottom with the following contents and save:127.0.0.1 localhost.simplereport.gov
- Follow these steps from GitHub for authenticating to the container registry.
- Run
yarn start
in the root of the repository to start the app - Make your user a support admin by assigning yourself the
SR-DEV-ADMINS
group in Okta Preview. - When the frontend and backend builds are complete, visit https://localhost.simplereport.gov/app
You should see the support admin page. The application does not yet start with any seed data, so you'll need to add your own organization and facilities. You can create your first org at https://localhost.simplereport.gov/app/sign-up.
Make sure docker has access to enough resources on your local machine. You'll know it doesn't if you get an error from any of your containers similar to this:
"The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process."
How to update resource limits on your Mac, and Windows machines.
- Getting Started
- [Setup] Docker and docker compose development
- [Setup] IntelliJ run configurations
- [Setup] Running DB outside of Docker (optional)
- [Setup] Running nginx locally (optional)
- [Setup] Running outside of docker
- Accessing and testing weird parts of the app on local dev
- Accessing patient experience in local dev
- API Testing with Insomnia
- Cypress
- How to run e2e locally for development
- E2E tests
- Database maintenance
- MailHog
- Running tests
- SendGrid
- Setting up okta
- Sonar
- Storybook and Chromatic
- Twilio
- User roles
- Wiremock
- CSV Uploader
- Log local DB queries
- Code review and PR conventions
- SimpleReport Style Guide
- How to Review and Test Pull Requests for Dependabot
- How to Review and Test Pull Requests with Terraform Changes
- SimpleReport Deployment Process
- Adding a Developer
- Removing a developer
- Non-deterministic test tracker
- Alert Response - When You Know What is Wrong
- What to Do When You Have No Idea What is Wrong
- Main Branch Status
- Maintenance Mode
- Swapping Slots
- Monitoring
- Container Debugging
- Debugging the ReportStream Uploader
- Renew Azure Service Principal Credentials
- Releasing Changelog Locks
- Muting Alerts
- Architectural Decision Records
- Backend Stack Overview
- Frontend Overview
- Cloud Architecture
- Cloud Environments
- Database ERD
- External IDs
- GraphQL Flow
- Hibernate Lazy fetching and nested models
- Identity Verification (Experian)
- Spring Profile Management
- SR Result bulk uploader device validation logic
- Test Metadata and how we store it
- TestOrder vs TestEvent
- ReportStream Integration
- Feature Flag Setup
- FHIR Resources
- FHIR Conversions
- Okta E2E Integration
- Deploy Application Action
- Slack notifications for support escalations
- Creating a New Environment Within a Resource Group
- How to Add and Use Environment Variables in Azure
- Web Application Firewall (WAF) Troubleshooting and Maintenance
- How to Review and Test Pull Requests with Terraform Changes