Git Product home page Git Product logo

react-tutorial-docker's Introduction

React tutorial on Docker

This is a sample project to try the React tutorial on Docker. By using this, you can make the docker container which allows you to make a trial of React. To lean more about React tutorial, please read the React Tutorial below.

http://facebook.github.io/react/docs/tutorial.html

Required softwares

  • Docker
  • Docker Machine (Mac OS X)
  • Web Browser

Clone this repository

mkdir react_tutorial
cd react_tutorial
git clone https://github.com/bravewood/react-tutorial-docker .

Build image

docker build -t bravewood/react .

Run the container

bash run_docker.sh

Use the sample application

open the url

http://<your docker machine ip>:3000/

Show active containers

docker ps

Stop the container

docker stop my-react

Delete the container image

docker rm my-react

Login to the container shell

docker exec -i -t my-react /bin/bash

Compile your jsx code

To compile your code written in JSX style, you should execute the browserify command below.

# after logged in to the container shell

cd react-tutorial-master/
browserify -t reactify ./public/scripts/app.jsx -o ./public/scripts/app.js

Install an additional node module

# after logged in to the container shell

cd react-tutorial-master/
npm install watchify

How to edit the codes of the tutorial

After you execute the run_docker.sh command, your local codes will be mounted on the docker container and served by node server. That means, you will be able to edit the codes of tutorial and then the changes will be reflected on your browser immediately. Let's try to edit the codes located in lib/react-tutorial-master/public directory.

react-tutorial-docker's People

Contributors

bravewood avatar

Watchers

 avatar

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.