Update README.md
This commit is contained in:
parent
1cdf2ea816
commit
9d3d952619
@ -1,15 +1,46 @@
|
|||||||
# Backstory web frontend
|
# Backstory web frontend
|
||||||
|
|
||||||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
|
## Development
|
||||||
|
|
||||||
When building the main docker containers, this application is built and served as static content.
|
|
||||||
|
|
||||||
To use in development, you can launch the React server:
|
|
||||||
|
|
||||||
```
|
```
|
||||||
docker compose exec backstory /opt/backstory/shell
|
docker compose up frontend -d
|
||||||
cd frontend
|
|
||||||
npm start
|
|
||||||
```
|
```
|
||||||
|
|
||||||
At that point, you can then connect to the server running the container on port 3000.
|
The container bind mounts frontend/ into the container, and launches `npm start`. Once running, you can now access https://localhost:3000 to view the frontend.
|
||||||
|
|
||||||
|
To monitor progress and build errors:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose logs -f frontend
|
||||||
|
```
|
||||||
|
|
||||||
|
When you are happy with your changes and wish to deploy to production:
|
||||||
|
|
||||||
|
1. Commit your changes:
|
||||||
|
|
||||||
|
```
|
||||||
|
git commit
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Build the static deployed version:
|
||||||
|
```
|
||||||
|
docker compose exec frontend shell ./build.sh
|
||||||
|
```
|
||||||
|
|
||||||
|
3. If successful, tag your version:
|
||||||
|
|
||||||
|
```
|
||||||
|
git tag -a "deployed-$(date +%y%m%d)" -m "Deployed on $(date)"
|
||||||
|
```
|
||||||
|
|
||||||
|
4. Push your changes:
|
||||||
|
|
||||||
|
```
|
||||||
|
git push origin main --tags
|
||||||
|
```
|
||||||
|
|
||||||
|
## Production
|
||||||
|
|
||||||
|
Static production build is in `deployed`. You do not need to be running the frontend container once deployed to production.
|
||||||
|
|
||||||
|
When you run the `build.sh` script, it first builds to `build`. If that succeeds, it then runs `rsync -avprl --delete build/ deployed/` to update the deployed static content.
|
Loading…
x
Reference in New Issue
Block a user