Giter VIP home page Giter VIP logo

devops-bookstore-frontend's Introduction

DevOps Bookstore

A sample React app and accompanying Dockerfile for publishing the built app to NGINX

Instructions

Fork and Clone

Firstly make sure you fork this repository to your own GitHub account and the clone your forked version down to your local computer.

Running Locally

The application assumes you have Node and NPM installed.

It also assumes that you have the backend REST API running locally on port 3000.

To run the application locally you can run:

npm install

Followed by:

npm start

Running in Docker

The application can be deployed as a Docker container.

In order to run in docker, firstly make sure the dependencies are pulled down

npm install

Then build the react app

npm run build

Then build the Docker image

docker build -t bookstore-frontend:1.0 .

Once the image has built you can start up the container by running:

docker run --rm -it -p 8080:80 bookstore-frontend:1.0

Then you should be able to open up your browser and head to http://localhost:8080/

FAQ

When I run npm install it completes but shows vulernabilities, is this a problem?

Javascript packages can sometimes have vulnerabilities in them and if the versions (in the package.json) aren't updated then NPM highlights those vulnerabilities. For the purpose of this exercise you can ignore them, in production you would would to address them and update the versions.

I get a "ERROR [4/4] COPY build . " error when doing docker build

This happens if you've forgot to run the npm run build command before running the docker build.... command

devops-bookstore-frontend's People

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.