Utah Tech Logo

IT3300

DevOps virtualization

Docker React App from Container

Description

Before you begin, make sure you have nothing listening on port 80 of your vm. Another easy suggestion is to clone a new vm from a template and install docker on it.

Visit this website again. Remember that we have already done this app on a vm, now we want to jump down to the section “Building container images for each service”.

You should continue the tutorial until you get to Figure 10, or when you get to a mention of Kubernetes.

You should be able to show that your website now loads from a container.

To Pass off

Prove that you have done it. We will pass this off in class.

HINTS

When you get to the docker section, everything should work, but if you are working on a machine that is not localhost, you should edit the src/App.js in the frontend area and put the ip address of your remote machine that you are running on. In the README file of sa-logic, when you run your container you should use port 5000 for both sides… NOT 5050.

Here are the basic docker commands:

    git clone https://github.com/rinormaloku/k8s-mastery.git
    cd sa-frontend 
    sed -i 's/localhost/144.38.193.248/' src/App.js
    npm install
    npm run build
    docker build -t jfrontend .
    docker run -d -p 80:80 jfrontend
    cd ../sa-webapp
    mvn install
    docker build -t jwebapp .
    docker run -d -p 8080:8080 -e SA_LOGIC_API_URL='http://144.38.193.248:5000' jwebapp
    cd ../sa-logic
     docker build -t jlogic .
    docker run -d -p 5000:5000 jlogic