Commit e46ba497 authored by Markus Mößler's avatar Markus Mößler
Browse files

updated readme with deployment

parent 9ce85b34
Loading
Loading
Loading
Loading
+60 −1
Original line number Diff line number Diff line
@@ -187,3 +187,62 @@ export default App;
Save to reload and chekc the change on

* [http://localhost:3000](http://localhost:3000)

## Deployment

### Step 1) Configuration

For more information on the deployment see, e.g.,

* [Create react app: Available scripts](https://create-react-app.dev/docs/available-scripts)
* [Create react app: Deployment](https://create-react-app.dev/docs/deployment)

For building for relative paths, i.e., for deployment on a relative path ([see](https://create-react-app.dev/docs/deployment#building-for-relative-paths)), an entry for the homepage has to be added to the `package.json` file.

For the deployment as part of the gitlab page of this repository the following entry is used,

```json
  "homepage": "https://mmoessler.aidaho-pages.uni-hohenheim.de/aidaho-tinkering-club-web-app/react-build/",
```

### Step 2) Build the react app

Start and enter the node container

```bash
docker run -it --rm -v $(pwd)/react-frontend/my-react-app:/app -w /app node:16 bash
```

Build the react app

```bash
# build application
npm run build
```

This cerates the directory `./react-frontend/my-react-app/build`  with all neccessary files for a static deployment.

The directory contains the following files for example,

```bash
.
├── asset-manifest.json
├── favicon.ico
├── index.html
├── logo192.png
├── logo512.png
├── manifest.json
├── robots.txt
└── static
    ├── css
    │   ├── main.f855e6bc.css
    │   └── main.f855e6bc.css.map
    ├── js
    │   ├── 488.103417aa.chunk.js
    │   ├── 488.103417aa.chunk.js.map
    │   ├── main.27d96172.js
    │   ├── main.27d96172.js.LICENSE.txt
    │   └── main.27d96172.js.map
    └── media
        └── logo.6ce24c58023cc2f8fd88fe9d219db6c6.svg
```
 No newline at end of file