In the section `Use Compose to develop locally`, a docker-compose file is shown which mounts the app directory into the `notes` container to be able to change the code without rebuilding the image. Unfortunately, the node_modules directory which was created during the build will be overridden as the whole working directory /app gets mounted. Therefore, this directory needs to be secured by adding it to the volumes.
This commit fixes the error thrown due to a typo in the command docker-compose -f docker-compose.dev.yml up --build. The correct command is docker compose -f docker-compose.dev.yml up --build without the hyphen between 'docker' and 'compose' in the command sequence.
This commit fixes the error thrown due to a typo in the command `docker-compose -f docker-compose.dev.yml up --build`.
The correct command is `docker compose -f docker-compose.dev.yml up --build` without the hyphen between 'docker' and 'compose' in the command sequence
* Update develop.md
this makes it clear that it is the "volumes" that can sync local code changes to that in the container.
* Update language/nodejs/develop.md
Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>
I added this as it might be confusing for some people who dont write in yaml every day to know what file it is. it is best to explicitly state what file type it is
* Update develop.md
- provided more clarity to the structure of the mongo database connection string used as CONNECTIONSTRING environment variable to run the docker image in the sample node.js project.
* Update develop.md
The JSON string was wrapped, causing the highlighter to consider it "output",
which cannot be selected/copied in "console" blocks.
This unwraps the JSON so that it can be copied.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- Add missing code-hints (console, yaml)
- Consistently add an empty line after code-blocks
- Combine some examples where the output and the command were
put in separate blocks. With the "console" code-hint, this
is no longer nescessary.
- fix indentation in cloud/ecs-integration.md, which caused the
numbered-list to be interrupted.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
* add explicit instruction to stop local server
This relates to the [Test the application section of the Build images tutorial](https://docs.docker.com/language/nodejs/build-images/#test-the-application).
In this section, `node server.js` is used to start the server locally. The reader is not instructed to stop the server.
In the [Run containers](https://docs.docker.com/language/nodejs/run-containers/) tutorial that follows this one, the reader is instructed to start up the container, and try to access `http://localhost:8000/test` which is now being served from the Node.js process inside the container. However, if the local Node.js process from the `node server.js` invocation earlier, they won't see the "Failed to connect to localhost port 8000" error which they're supposed to see.
So this modification adds an explicit instruction to the "Build containers" tutorial to stop the `node server.js` process, to avoid any potential confusion in the "Run containers" tutorial.
Great tutorials, btw!
* show what happens with Ctrl-c
add suggestions from @thaJeztah, plus the same language identifier on the triple-backtick quoted output earlier (`console`).
* Minor styling updates
Co-authored-by: Usha Mandya <47779042+usha-mandya@users.noreply.github.com>
* Update build-images.md
Small typos in the documentation, which may lead to confusion.
* Inspiration from node.js docs
Added documentation for why we copy `package*.json` before copying the whole directory. Checkout: https://nodejs.org/en/docs/guides/nodejs-docker-webapp/#creating-a-dockerfile.
The node.js docs has more optimized code too (using `npm ci` instead of `npm install`) which can be used here too.
* Fixed review provided and removed some weird whitespaces