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
* Docs: update sample application initiation in venv
Until now, readers would install 'Flask' on their main system
python environment, freeze their entire packages, and grep only
the 'Flask' package! So they would be missing all the other
dependencies in their requirements file.
With this commit, a better practice is followed. First, create a
clean virtual environment, then install 'Flask' and freeze
everything into the requirements file.
Also, I recommend using 'python3 -m pip freeze' instead of 'pip3
freeze' while in the virtual environment. This is because
sometimes hidden quirks of 'pip' will ignore the actiavted
environment and freeze the entire python packages in the
system (e.g. in ArchLinux).
* Docs: update python sample testing application
In the previous commit, I forgot to update the 'Test the
application' section so that the users activate the virtual
environment first.
This commit fixes that.
Co-authored-by: Stefan Scherer <stefan.scherer@docker.com>
There is no logic in that Flask app to save widgets, so I reworded the two sentences that referenced saving widgets.
There are two routes:
1. `/widgets` -> Gets all the rows from the `widgets` table
2. `/initdb` -> Drops the DB/Table and rebuilds them from scratch
* 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>
* python indetation 4 spaces acording to PEP8
* docker-compose example networking explanation
exlpain why no need to connect the 2 containers to a network