Git Product home page Git Product logo

hello-docker-react's Introduction

hello-docker-react

Your React.js environment in just one command using create-react-app, docker and yarn.

Docker && docker-compose installation instructions:

Install docker in your host machine:

Install docker-compose in your host machine (only for linux users as docker-compose come preinstalled in Docker for Windows, Docker for Mac and Docker toolbox).

Extra recommended optional step for allowing linux non-root users to run docker commands:

  • $ sudo usermod -aG docker $USER

Build and start your React environment with single command:

Just run:

  • $ docker-compose up

And wait until you see the following in the console:

hello-docker-react    | Starting the development server...
hello-docker-react    | 
hello-docker-react    | Compiled successfully!
hello-docker-react    | 
hello-docker-react    | The app is running at:
hello-docker-react    | 
hello-docker-react    |   http://localhost:3000/
hello-docker-react    | 
hello-docker-react    | Note that the development build is not optimized.
hello-docker-react    | To create a production build, use yarn run build.
  • To gracefully stop undetached run just press CTRL+C

Test your React Installation:

Extra Bonus! Docker-compose basic handling:

Run in detached mode:

  • $ docker-compose up -d

In detached mode, you won't have direct output from the container, so you'll have to check the container logs to see if the build ended (find the above "Compiled successfully" message):

  • $ docker-compose logs

Stop a detached mode run:

  • $ docker-compose down

Run commands into your container without going into, from your host machine:

  • $ docker-compose exec hello-docker-react mycommand

Enter into your container to run commands inside it (ssh-like):

  • $ docker-compose exec hello-docker-react bash

Exit your container, and go back to your host machine:

  • $ exit

For advanced usage, follow the docker-compose command-line reference:

https://docs.docker.com/compose/reference/

Doubts? Ideas? Corrections?

Send an Issue, a pull request or knock me at Twitter: @lopezator

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.