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.
This PR aims to make the experience of developing a new feature for NOMAD slightly smoother.
The general workflow of a developer when making a new branch is:
cp -r env-example env
ADMIN_PASSWORD
andJWT_SECRET
entries inenv/backend.env
ADMIN_PASSWORD
andJWT_SECRET
entries inenv/backend-test.env
client
service indocker-compose.yaml
docker compose up
to create a new developer instanceI don't think steps 2, 3, 4 and 5 should be necessary.
To remove the need for this I've made the following changes:
envs
, this holds the oldenv-example
directory as well as a newdev
directory. Thedev
directory has preconfigured values forADMIN_PASSWORD
ANDJWT_SECRET
suitable for developmentdocker-compose.yaml
file now usesenvs/dev/backend.env
andfrontend.env
client
profile to theclient
service indocker-compose.yaml
This means that if the developer is using the client they can rundocker compose --profile client up
which will enable this service but it will be off by defaultThere is also a change I've made to
nomad-rest-api/Dockerfile
. Currently, when a new dependency is added, it is kind of hard to update the dependencies in the dev containers. This is because the dependencies are placed into a separate volume called/app/node_modules
. If I change thepackage.json
and rebuild the image, it does not update the content in the/app/node_modules
volume, since building an image happens before a volume is attached. Once the volume is attached to the container, it hides the new content of/app/node_modules
and uses the old deps.So the only way to update my deps for the docker container is to delete the volume, which is kind of inconvenient, not only because it requires an additional command but also because the
/app/node_modules
volume is anonymous and therefore hard to identify.However, by changing the Docker to command:
npm install && ...
every timedocker compose up
is run again, and the container is entered after the volume is attached,npm install
will be run and the volume will have its contents updated.TLDR: The only thing now necessary to update deps in the dev container should be re-running
docker compose up