Code Monkey home page Code Monkey logo

docker-react-backend's Introduction

Docker React

This docker React example is used to create a container running node for React projects. All the React content runs in the host side, the container is used only to run the application inside the node enviroment, so, this way you don't need to install node versions in the host.

How to use

  • After clone this repo, use the terminal and navigate to the 'react-app' folder
  • Inside the 'react-app' folder, use 'npm install' to install all the dependencies
  • Use 'docker-compose up' to start the container running your app

Tips

  • Edit .env file in order to change the name of the container and change the default (3000) port
  • You need to change the CONTAINER_PREFIX and APP_PORT inside the .env file in order to create many containers

How to use Docker with a React already created

To use this Dockerfile and docker-compose.yml in a project already created (using create-react-app), just copy the Dockerfile and docker-compose.yml and put them in the root of your react app.

After that, just call the 'docker-compose up' and it will just start the container for you.

Why node alpine version?

The node tagged with alpine is lightweight than default node. the alpine is secure and has all you need to run a simple react app.

If you want to use the node default, it will be weight but it allow you to use bash: docker run -it --entrypoint /bin/bash my_node_image

docker-react-backend's People

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

gj7i7o

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.