Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/coffezilla/docker-react-backend
React with PHP backend
https://github.com/coffezilla/docker-react-backend
docker docker-php docker-react reactjs
Last synced: about 1 month ago
JSON representation
React with PHP backend
- Host: GitHub
- URL: https://github.com/coffezilla/docker-react-backend
- Owner: coffezilla
- Created: 2021-10-18T15:31:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-10-18T23:37:26.000Z (about 3 years ago)
- Last Synced: 2024-04-28T20:24:37.699Z (8 months ago)
- Topics: docker, docker-php, docker-react, reactjs
- Language: HTML
- Homepage:
- Size: 188 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- 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**