This project is a docker image for developing Node.js and Python web projects. It is an essential tool for the Canonical web team local development.
- Based on ubuntu:focal
- Python 3.8
- Node 16 LTS
- Yarn
- dotrun-docker
dotrun-docker is a Python package inside the Docker image. It simplifies running Canonical web projects:
- Make use of standard
package.json
script entrypoints:dotrun
runsyarn run start
dotrun foo
runsyarn run foo
- Detect changes in
package.json
and only runyarn install
when needed - Detect changes in
requirements.txt
and only runpip3 install
when needed - Run scripts using environment variables from
.env
and.env.local
files - Keep python dependencies in
.venv
in the project folder for easy access
Before running this image locally, you should know that it is an essential part of dotrun, our python package for running Canonical websites. If you are interested in running our web projects, visit our dotrun repository.
If you prefer to access this image directly and work on it, then you can run it and access a bash environment with:
docker run -it canonicalwebteam/dotrun-image:latest /bin/bash
These are the dotrun-docker
commands available inside our image:
$ dotrun # Install dependencies and run the `start` script from package.json
$ dotrun clean # Delete `node_modules`, `.venv`, `.dotrun.json`, and run `yarn run clean`
$ dotrun install # Force install node and python dependencies
$ dotrun exec # Start a shell inside the dotrun environment
$ dotrun exec {command} # Run {command} inside the dotrun environment
$ dotrun {script-name} # Install dependencies and run `yarn run {script-name}`
$ dotrun -s {script} # Run {script} but skip installing dependencies
$ dotrun --env FOO=bar {script} # Run {script} with FOO environment variable
To QA any changes to this image, you probably want to build a local image with Docker:
docker build . --tag canonicalwebteam/dotrun-image:local
Changes to the default branch will trigger a new release using GitHub Actions.
- Released to Docker Hub canonicalwebteam/dotrun-image
- Architectures: AMD64 and ARM64
This image is automatically built and released every month. This is to ensure dependencies are up to date on local development when using dotrun.