Sign inSign up

kamehardy/node-express-app

By kamehardy

•Updated about 6 years ago

Image
0

244

kamehardy/node-express-app repository overview

⁠ASE Interview Project

⁠Overview⁠

This repository contains the files for a web-based user directory that utilizes Node.JS⁠ and the Express framework⁠. It creates a simple web page that allows you to view the user directory and add/delete users from it using AJAX⁠ API requests. The user directory is hosted using a MongoDB⁠ database. Each component has the ability to be ran in a separate container

⁠Presentation⁠

I created a presentation to talk about how I approached this project and the various things I learned while creating this. Check out the presentation here⁠

⁠How to Run⁠

To run this application you must have Docker⁠ and Docker-Compose⁠

  • Note that for Docker Desktop, Docker compose is included as part of those desktop installs
  1. Clone this repository on your local machine git clone https://github.com/kamieliz/ASE-Interview-P1.git
  2. Change directory into directory for Repo cd ASE-Interview-P1
  3. Start up application docker-compose up
    • flags like -d let you run the app detached from your terminal
    • use docker-compose ps to see what is currently running
  4. Enter http://localhost:8080/⁠ in a browser to see the application running
  5. Test add user and delete user functions
  6. If you started Compose with docker-compose up -d use docker-compose stop to stop your service once done.
    • If you did not use detach flag hit CTRL + C

⁠Running with Jenkins⁠

I created a Docker image that builds Jenkins with Docker in the same container.

  1. Using the same repository run:
    docker run -it -v /var/run/docker.sock:/var/run/docker.sock -p8080:8080 
    kamehardy/jenkins-withdocker:latest
    
  2. Open jenkins webpage http://localhost:8080
  3. Log in with suggested admin password thats printed out in success code
  4. Install suggested plugins and continue as admin
  5. Create a new item
  6. Go back to dashboard and Select Credentials to add Docker Hub credentials
    • username: Docker user name
    • password: Docker password
    • ID: docker-hub-credential
    • Save
  7. Go back to the dashboard and select pipeline
  8. Select Build Now
  9. Once task starts click on the build number and select console output
  10. Wait for Success

⁠Sources⁠

To Build the Web Application, I used materials from the following tutorials:

To connect to Docker and utilize Docker-Compose:

Using Jenkins for automation:

Ansible and Orchestration: To view ansible attempt check out ansible folder

Tag summary

Content type

Image

Digest

Size

356 MB

Last updated

about 6 years ago

docker pull kamehardy/node-express-app