Weeknotes 10
5th September, 2021
“Docker on Apple M1, and writing tests”
-
When deploying to Heroku I’ve always used the git push method but you can also deploy Docker containers, and I did so this week. I was expecting to have to tweak my Dockerfile in some way, however I was pleasantly surprised that everything just worked.
heroku container:push web --app <app> heroku container:release web --app <app>
I ran into a small issue because I was deploying from an Apple M1-based computer but it was easily remedied by setting an environment variable.
export DOCKER_DEFAULT_PLATFORM=linux/amd64 heroku container:push web --app live-transcriber-api heroku container:release web --app <app>
This allows us to run the same containers in development as well as production so it’s a big win for productivity.
-
Writing tests for existing code is so much harder after the implementation. But it’s important to fill in any gaps in coverage before making changes, so this week I was doing that. It was a lot trickier than I was expecting as the tests needed to cover many areas of the codebase that I was unfamiliar with so I had to learn how everything worked as I went. It feels good to have improved the test coverage.