https://github.com/matrizlab/docker-react-admin
Docker React-Admin
https://github.com/matrizlab/docker-react-admin
docker react-admin reactjs
Last synced: 9 months ago
JSON representation
Docker React-Admin
- Host: GitHub
- URL: https://github.com/matrizlab/docker-react-admin
- Owner: matrizlab
- Created: 2021-03-20T09:44:01.000Z (almost 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-03-21T06:49:11.000Z (almost 5 years ago)
- Last Synced: 2025-03-24T16:02:32.379Z (9 months ago)
- Topics: docker, react-admin, reactjs
- Language: JavaScript
- Homepage:
- Size: 204 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Docker React-Admin
```shell script
npx create-react-app docker-react-admin
```
**Dockerfile**
```dockerfile
# pull official base image
FROM node:14.16.0-alpine
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install
# add app
COPY . ./
# start app
CMD ["npm", "start"]
```
**.dockerignore**
```.gitignore
node_modules
npm-debug.log
build
.dockerignore
**/.git
**/.DS_Store
**/node_modules
```
```shell script
docker build -t react-admin:dev .
```
**docker-compose.yml**
```dockerfile
version: '3.7'
services:
react-admin:
container_name: react-admin
build:
context: .
dockerfile: Dockerfile
volumes:
- '.:/app'
- '/app/node_modules'
ports:
- 3001:3000
environment:
- CHOKIDAR_USEPOLLING=true
stdin_open: true
```
```shell script
docker-compose up -d --build
```
```shell script
docker exec -it sh
```
```shell script
npm i react-admin ra-data-json-server prop-types
```
```shell script
npm r react-admin ra-data-json-server prop-types
```