Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coffezilla/docker-react
Docker ReactJS + Node
https://github.com/coffezilla/docker-react
docker docker-compose docker-node docker-react
Last synced: about 1 month ago
JSON representation
Docker ReactJS + Node
- Host: GitHub
- URL: https://github.com/coffezilla/docker-react
- Owner: coffezilla
- Created: 2021-10-08T02:41:51.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T15:58:05.000Z (about 3 years ago)
- Last Synced: 2024-04-28T20:24:39.604Z (8 months ago)
- Topics: docker, docker-compose, docker-node, docker-react
- Language: HTML
- Homepage:
- Size: 223 KB
- Stars: 7
- Watchers: 2
- Forks: 7
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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**