> git clone
> sudo docker image build -t < container name here> .
> sudo docker container run -it -p 3000:3000 -p 35729:35729 -v $(pwd):/app < container name here >
> sudo docker container run -it -v $(pwd):/app < container name here > test
sudo docker container run -it -v $(pwd):/app < container name here > test --coverage
sudo docker container run -it -v $(pwd):/app < container name here > test --help
> sudo docker container run -it -p 3000:3000 -p 35729:35729 -v $(pwd):/app --name mydebugging < container name here >
####################### open a separate terminal ###################
> sudo docker exec -it mydebugging bash
######################################################################
> this will give you root access to your container terminal
> sudo docker container run -it -v $(pwd):/app < container name here > build
FROM node:8
ADD yarn.lock /yarn.lock
ADD package.json /package.json
ENV NODE_PATH=/node_modules
ENV PATH=$PATH:/node_modules/.bin
RUN yarn
WORKDIR /app
ADD . /app
EXPOSE 3000
EXPOSE 35729
ENTRYPOINT ["/bin/bash", "/app/run.sh"]
CMD ["start"]
#!/usr/bin/env bash
set -eo pipefail
case $1 in
start)
# The '| cat' is to trick Node that this is an non-TTY terminal
# then react-scripts won't clear the console.
yarn start | cat
;;
build)
yarn build
;;
test)
yarn test $@
;;
*)
exec "$@"
;;
esac
Why not add a docker-compose file?
link > Futher documentaion here
This project was bootstrapped with Create React App and Docker