This is an example of an basic docker setup for a node api
docker build -t node-api:v1 .
docker network create node-api-network
docker run \
--rm \
-d \
--name mysql_server \
-e MYSQL_DATABASE='test_db' \
-e MYSQL_USER='dan' \
-e MYSQL_PASSWORD='secret' \
-e MYSQL_ROOT_PASSWORD='secret' \
--network node-api-network \
mysql:8.0
docker run \
--rm \
--name node-app \
--network node-api-network \
-p 3000:3000 \
-v $(pwd):/app \
node-api:v1
docker stop node-app
docker stop mysql_server
docker-compose up
docker-compose down