Git Product home page Git Product logo

react-docker's Introduction

Docker for React

This is a simple docker configuration for React. It is suitable for both development and production environments.

For development

First, update the APP_CONTAINER_NAME and APP_PORT variables in the .env file if you want to change the container name and the port number.

cp .env.example .env

And change variables. Example:

APP_CONTAINER_NAME=react-app
APP_PORT=3001

Then, run the following command to start the development server:

docker compose up -d

Now, you can access the development server at http://localhost:3001.

For production

First, update the APP_CONTAINER_NAME and APP_PORT variables in the .env file if you want to change the container name and the port number.

cp .env.example .env

And change variables. Example:

APP_CONTAINER_NAME=react-app-prod
PROD_APP_PORT=85

Then, run the following command to build the production image:

docker compose -f docker-compose.prod.yml up -d --build

Now, you can access the production server at http://localhost:85.

Important

Note

Every time you change the source code, you need to rebuild the image by running the above command again.

react-docker's People

Contributors

tanhongit avatar thuankg1752 avatar

Stargazers

 avatar  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.