Answer the question
In order to leave comments, you need to log in
What is the best way to develop a project with docker?
I'm just getting started with the angular, node, mongo and Docker stack, there is a project that runs with different separate containers from nginx, redis, mongo and npm images the application itself is in angular, koa with webpack.
All this is put into a small bash script with different commands
#!/bin/bash
SERVICE_NAME="web_app"
if ; then
docker-compose up -d [email protected]
elif [ $1 = 'restart' ]; then
docker-compose down && docker-compose up -d [email protected]
elif [ $1 = 'dev' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME npm run dev ${@:2}
elif [ $1 = 'test' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME npm run test ${@:2}
elif [ $1 = 'debug' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME npm run dev:debug ${@:2}
elif [ $1 = 'exec' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME ${@:2}
elif [ $1 = 'i' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME npm i --save ${@:2}
elif [ $1 = 'idev' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME npm i --save-dev ${@:2}
elif [ $1 = 'un' ]; then
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run --rm --service-ports $SERVICE_NAME npm un -save ${@:2}
elif [ $1 = 'build' ]; then
docker-compose build "${@:2}" --no-cache
elif [ $1 = 'rebuild' ]; then
docker-compose build --no-cache
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run $SERVICE_NAME npm i
docker-compose -f docker-compose.yml -f docker-compose.dev.yml run $SERVICE_NAME npm run build
else
docker-compose up -d [email protected]
fi
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question