Messing around with Docker.
This project works with docker to test, build and start a simple react app and also uses Jenkins to auto deploy.
- brew install node
- npm install -g create-react-app (optional: npm install -g react-scripts)
- create-react-app frontend
- cd frontend
- npm [run] test
- npm run build
- npm [run] start (dev)
- docker build [-t USER/IMAGE_NAME:TAG] -f Dockerfile.dev .
- rm -rf node_modules # created by
npm run build
, not needed because # will be created withRUN npm install
in Dockerfile - docker build [-t USER/IMAGE_NAME:TAG] -f Dockerfile.dev .
- docker run
-v /var/local/app/node_modules \ # don't map volume, use container's -v $(pwd):/var/local/app \ # map server volume to container's -p 8083:3000 IMAGE - docker-compose up
- docker exec -it frontend_react-app_1 npm test
- install AWS ElasticBeanstalk CLI (eb)
- initialize the EB environment:
eb init [--profile PROFILE]
- deploy to EB:
eb deploy [--staged]