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

Add startDevForDockerCompose.sh and use it in docker compose for auto npm install #14

Merged
merged 4 commits into from
Oct 7, 2024

Conversation

francisduvivier
Copy link
Collaborator

This PR:

  • Installs node modules from the node container upon startup.
  • Updates the README to reflect that
  • adds a little bit of extra documentation

It's a little bit of overhead, but

  • if the node_modules are already installed, then this command only takes 1 second on an 8 year old i5 laptop, so seems fine.
  • if the wrong node_modules are installed (eg if install was ran directly from a mac host), it will fix this.

@francisduvivier francisduvivier force-pushed the refactor/docker-start-script-for-no-node-modules branch 2 times, most recently from 6c6ba0b to add1078 Compare October 7, 2024 19:33
@@ -14,7 +14,7 @@
"dev": "node --import tsx --watch src/index.ts",
"backup": "docker exec -it badgehub-api-db-1 /usr/bin/pg_dump --username badgehub badgehub -f /var/backup/data-backup-`date +\"%Y-%m-%dT%H:%m\"`.sql",
"test": "vitest",
"prepare": "husky install"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

install command is apparently deprecated, just husky does the job

Copy link

Choose a reason for hiding this comment

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

This is correct.

@francisduvivier
Copy link
Collaborator Author

Not ready yet, first install is not working yet because of husky

@francisduvivier francisduvivier force-pushed the refactor/docker-start-script-for-no-node-modules branch from adfa5ea to 1232a94 Compare October 7, 2024 20:23
@francisduvivier francisduvivier force-pushed the refactor/docker-start-script-for-no-node-modules branch from 1232a94 to 8936b1b Compare October 7, 2024 20:24
Copy link

github-actions bot commented Oct 7, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 25.21% 149 / 591
🔵 Statements 25.21% 149 / 591
🔵 Functions 33.33% 4 / 12
🔵 Branches 57.14% 4 / 7
File CoverageNo changed files found.
Generated in workflow #29 for commit 8936b1b by the Vitest Coverage Report Action

@edwinm edwinm merged commit 8381ccd into main Oct 7, 2024
1 check passed
@edwinm edwinm deleted the refactor/docker-start-script-for-no-node-modules branch October 7, 2024 21:44
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.

3 participants