Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jidea-59 Dockerise web app #19

Merged
merged 32 commits into from
Aug 29, 2024
Merged

jidea-59 Dockerise web app #19

merged 32 commits into from
Aug 29, 2024

Conversation

EmmaLRussell
Copy link
Contributor

@EmmaLRussell EmmaLRussell commented Aug 8, 2024

This branch adds a Dockerfile and related scripts for the web app. It also pushes both the web app and database containers to the github registry during CI - the SHA tag is always pushed, the branch tag is only pushed on CI success.

You should be able to follow the instructions in the README on running locally in docker. You should see that scenario enumeration and API versions are successfully retrieved, showing that the db and API are accessible to the app container.

You should also still be able to run the app outside docker when dependencies are running!

Key changes:

  • docker/Dockerfile - the web app dockerfile, which copies over all source, installs and builds the app. The startup command applies database migrations (so db container must be running before web app container), then runs the app.
  • docker/build, docker/run and docker/push scripts to build, run and push the app container (SHA tag).
  • I've modified the db/scripts/build tag to use the SHA tag (for consistency, and assuming for local development you want to work with the latest SHA), and also added a push script for the db
  • added a push-branch-tag script to push the branch tags of both containers
  • expanded the playwright gha to now include docker build and push. The app is run in docker before running Playwright tests against it.
  • run-dependencies runs the containers in a network, so they can talk to each other. Added an env.docker file for the urls of the API and database within the network, which is injected into the web app container in docker/run.
  • moved common file into docker as it seemed to make more sense there.

Copy link

codecov bot commented Aug 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.02%. Comparing base (1546852) to head (3735157).
Report is 33 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #19   +/-   ##
=======================================
  Coverage   54.02%   54.02%           
=======================================
  Files          22       22           
  Lines         509      509           
  Branches       35       35           
=======================================
  Hits          275      275           
  Misses        226      226           
  Partials        8        8           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@EmmaLRussell EmmaLRussell marked this pull request as ready for review August 16, 2024 10:08
Copy link
Contributor

@david-mears-2 david-mears-2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you recall what caused the differences in package-lock.json?

README.md Outdated Show resolved Hide resolved
scripts/run-dependencies Show resolved Hide resolved
docker/run Show resolved Hide resolved
docker/Dockerfile Outdated Show resolved Hide resolved
.github/workflows/docker-e2e.yml Outdated Show resolved Hide resolved
env.docker Show resolved Hide resolved
db/scripts/push Outdated Show resolved Hide resolved
playwright.config.ts Show resolved Hide resolved
@EmmaLRussell
Copy link
Contributor Author

EmmaLRussell commented Aug 19, 2024

Do you recall what caused the differences in package-lock.json?

Yeah, I took out the lint on commit stuff when I was restricted to my Windows laptop which didn't get on with it. Accidentally committed, and re-installed, so package lock got refreshed!

docker/Dockerfile Outdated Show resolved Hide resolved
env.docker Show resolved Hide resolved
Copy link
Contributor

@david-mears-2 david-mears-2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!!!

@EmmaLRussell EmmaLRussell merged commit bee45e8 into main Aug 29, 2024
6 checks passed
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