This is a super basic skeleton for running an Express API with Mongo in Docker. Code is mapped into the Node container with a volume and hot code reloading is enabled. MongoDB data is not persisted to the host.
- Docker
- Docker Compose
docker-compose build
Note: This step creates ./node_modules on the host.
docker-compose run --rm api npm install
docker-compose up -d
Visit http://localhost:8080/api
docker-compose logs -f
docker-compose down
docker-compose run --rm api npm --save <PACKAGE_NAME>