local dev upgrades #3
Merged
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.
Provided some local orchestration that allows us to connect the admin and redis services within this repo to one another, as well as to the notifications-api repo via docker containers. We are also making use of vscode devcontainers, which allow for hot-reloading the admin flask and node apps, without needing to install locally, restart containers or re-establish networking.
Step to set up:
NOTE: You'll only need to create the docker network once to connect both repos, using:
docker network create notify-network. You'll need to install (again, only once) the Visual Studio Code Remote - Containers extension to make use of the devcontainer sugar.NOTE: If you make a change to the Dockerfile, make sure to rebuild the correlated docker image. If you make a change to the docker-compose.devcontainer.yml file, or the .env file, make sure to rebuild the correlated container. VScode should prompt you with an actionable notification asking to rebuild the containers when it detects one of these changes, but it does not always do so reliably/predictably (it's also easy to miss these temporary toast notifications).
NOTE: The next step will fail without an .env file present at the top level of this repo⚠️ See sample.env for details. If you ran without .env and it failed, see the note above.
Once installed, you can use
command+shift+pto open the command pallet and select Remote-Containers: Open Folder in Container, then select thedevcontainer-admindirectory.Vscode will build the container and establish networking. I recommend selecting "show logs" in the bottom-right. You can unhide hidden toast messages about the build by clicking the notifications bell in the far bottom-right. Once the container has finished building, you should see a "ports" tab in the terminal window (cmd-j) and it should show at least one mapped port for 6012. You should also see logs for the gulp process building out the node app.
Open a new terminal instance with the plus button and enter
make run-flask. At this point, you should be able to access the notify front-end on at0.0.0.0:6012. If you already have the notifications-api up and running and you see the site without an error message, it has successfully connected locally to the notifications api 🎉