This is a multi-container docker environment that utilizes Travis CI for CI\CD and deploys to AWS. It is a personal portfolio to build upon my developer skills and showcase my work.
- Push code in branch to Github
- Travis automatically pulls repository
- Travis builds test images for React and Node, and then runs tests
- Travis builds production images
- Travis pushes built production images to Docker Hub repository
- Travis pushes project to AWS ElasticBeanstalk
- AWS ElasticBeanstalk reads Dockerrun.aws.json, pulls images from Docker Hub repository and deploys
The best way to build is via docker containers. You do not need to install packages locally via npm
unless you
are adding new libraries.
- Client and Server can each be run separately by navigating into their respective directories and running
npm run
,npm test
, etc. - When started through
docker-compose
, the client and server containers are linked through annginx
reverse proxy that acts as the gateway to each service.nginx
runs on the accessible port of8080
, which you use when openinglocalhost
to view the application.client
runs on port3000
whichnginx
connects to.server
runs on port5000
whichnginx
connects to and allowsclient
to access the apis available.
- Docker
- Node.js
- AWS ElasticBeanstalk CLI (only if you're using ElasticBeanstalk)
- Run
.\local_scripts\docker_compose_dev.ps1
- Open
http://localhost:8080
- Run
docker-compose -f .\docker-compose.dev.yml up -d --build
in terminal - Open
http://localhost:8080
- In
docker-compose.yml
ordocker-compose.dev.yml
changeimage:
values to match<your-repo>/<service-name>
- Run
docker push <your-repo>/<service-name>
for each service
NOTE: This assumes you have an account with AWS
- To deploy to AWS EB, you must have the EB CLI Installed
- Run
eb init
to configure your settings - Run
eb create <your-service-name>
- Final result should be
Environment update completed successfully.
- To update, run
eb deploy
- To open in browser run
eb open
- To terminate the environment and all created dependencies run
eb terminate
This is LICENSED with Apache 2.0. See LICENSE