Introduction
Main purpose of this project is to learn how to create a docker container.
This projects runs smashtest via a docker container.
Additional steps for creating a docker container will be added to this project readme.
Prerequisite
Ensure nodejs is installed. Nodejs installation instructions
How-to Run
docker-compose down- to ensure nothing is left over.docker-compose build- to build the containerdocker-compose up -d- Run's a container with node and smashtest code.docker-compose run --rm testserver npx smashtest- Executes thenpx smashtestcommand against the docker-compose'd container.
How-to Clean-up
NOTE This will delete all containers and images. If you want a more targetted clean up specify each container and image.
docker-compose downdocker container prune -fdocker image prune -f --all
Lessons learnt:
- yml files are very specific with whitespace for name:value and everything else.
- best not to use a latest specified image as it seems docker-compose will always check and download it.
- This maybe obvious but dockerfile and docker-compose have differences understanding what's runnig from which section is important. Eg. When to use them to run/volume map etc matters.