Skip to content

Commit a26f4fd

Browse files
docs: updated readme with more information for reverse-proxy
1 parent cddd240 commit a26f4fd

File tree

5 files changed

+59
-30
lines changed

5 files changed

+59
-30
lines changed

.github/workflows/release.yaml

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@ jobs:
6464
push: true
6565
tags: ghcr.io/${{ github.repository }}:${{steps.version.outputs.VERSION}}
6666

67-
- name: "release"
68-
env:
69-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
70-
run: |
71-
npm install @semantic-release/exec -D
72-
npm install @semantic-release/changelog -D
73-
npm install @semantic-release/github -D
74-
npm install @semantic-release/git -D
75-
npx semantic-release
76-
7767
docker-reverse-proxy:
7868
name: "Docker w/Proxy image"
7969
runs-on: ubuntu-latest
@@ -129,4 +119,26 @@ jobs:
129119
file: Dockerfile.Caddy
130120
platforms: linux/amd64,linux/arm64
131121
push: true
132-
tags: ghcr.io/${{ github.repository }}:${{steps.version.outputs.VERSION}}-proxy
122+
tags: ghcr.io/${{ github.repository }}:${{steps.version.outputs.VERSION}}-proxy
123+
124+
release:
125+
name: "Release"
126+
needs: [docker,docker-reverse-proxy]
127+
runs-on: ubuntu-latest
128+
steps:
129+
- id: checkout
130+
name: Checkout Repository
131+
uses: actions/checkout@v3
132+
133+
- name: Setup Nodejs
134+
uses: actions/setup-node@v3
135+
with:
136+
node-version: 18
137+
138+
- name: Install dependencies
139+
run: npm ci
140+
141+
- name: "release"
142+
env:
143+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
144+
run: npx semantic-release

Makefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1+
.PHONY: build
12

2-
build:
3+
build: clean
4+
@echo "Building..."
35
npm run build
46

57
start:
68
@echo "Starting..."
79
npm run start
810

9-
start-prod: clean
11+
start-prod: clean build
1012
@echo "Starting production server"
11-
npm run start-prod
13+
npm run server-prod
1214

1315
clean:
1416
@echo "Cleaning..."

README.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Hello Universe accepts the following environment variables:
3737
|-------------|----------------------------------------------------|-----------|
3838
| API_URI | The fully qualified hostname and port of the API server, such as `http://localhost:3000` | "" |
3939
| API_VERSION | The API version number | `1` |
40+
| REVERSE_PROXY| Enable to use the reverse proxy. This value is set to `true` in the proxy container image. |`false`|
4041

4142

4243
## Connecting to API Server
@@ -45,14 +46,25 @@ Hello Universe's capabilities can be expanded if connected to the [Hello Univers
4546
To connect Hello Universe to the API server, provide the API server's fully qualified hostname and port as an environment variable value.
4647
Be aware that the API server requires an available Postgres database. Checkout [Hello Universe DB](https://github.com/spectrocloud/hello-universe-db) for a dockerized Postgres instance ready for integration with the Hello Universe API.
4748

49+
4850
```shell
4951
API_URI=http://localhost:3000
5052
```
5153

5254
If you are using the Docker image then use the `-e` flag parameter.
5355

5456
```shell
55-
docker run -p 8080:8080 -e API_URI=http://localhost:3000 ghcr.io/spectrocloud/hello-universe:1.0.4
57+
docker run -p 8080:8080 -e API_URI=http://localhost:3000 ghcr.io/spectrocloud/hello-universe:1.0.4
58+
```
59+
60+
### Reverse Proxy
61+
62+
A Docker container with a reverse proxy for `http://0.0.0.0:3000` is available. The reverse proxy is usefull for scenarios when you need to deploy the
63+
hello universe application into a Kubernetes cluster or similar architectures and need the UI to route requests internal to the hosting platform
64+
to reach the API. **The reverse proxy expects the API to be listening on port `3000`.**
65+
66+
```shell
67+
docker run -p 8080:8080 -e API_URI="http://myprivate.api.address.example:3000" ghcr.io/spectrocloud/hello-universe:1.0.5-proxy
5668
```
5769

5870
# Development
@@ -67,6 +79,11 @@ REACT_APP_API_VERSION=1
6779
The `.env` file is how you point to the local development API server. Otherwise, you will use the global API counter.
6880

6981

82+
## Clean
83+
To remove the build folder use the command `make clean`
84+
85+
## Build
86+
To build the hosting assets use the command `make build`
7087
### Development Server
7188
To start the local development server without a proxy use the command `make start`.
7289

local-caddyfile

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,16 @@
44
try_files {path} /index.html
55
file_server
66
header Access-Control-Allow-Origin *
7-
header Access-Control-Allow-Methods *
7+
header Access-Control-Allow-Methods *
88

99
log {
1010
output file caddy.log {
11-
roll_size 1gb
12-
roll_keep 5
13-
roll_keep_for 720h
14-
}
11+
roll_size 1gb
12+
roll_keep 5
13+
roll_keep_for 720h
14+
}
1515
format json {
16-
time_format wall
17-
}
16+
time_format wall
17+
}
1818
}
1919
}
20-
21-

package-lock.json

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)