You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LABEL org.opencontainers.image.description "A Spectro Cloud demo application intended for learning and showcasing products. This image contains a reverse proxy."
| API_URI | The fully qualified hostname and port of the API server, such as `http://localhost:3000`| "" |
39
39
| 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`|
40
41
41
42
42
43
## Connecting to API Server
@@ -45,17 +46,55 @@ Hello Universe's capabilities can be expanded if connected to the [Hello Univers
45
46
To connect Hello Universe to the API server, provide the API server's fully qualified hostname and port as an environment variable value.
46
47
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.
47
48
49
+
48
50
```shell
49
51
API_URI=http://localhost:3000
50
52
```
51
53
52
54
If you are using the Docker image then use the `-e` flag parameter.
53
55
54
56
```shell
55
-
docker run -p 8080:8080 -e API_URI=http://localhost:3000 ghcr.io/spectrocloud/hello-universe:1.0.3
57
+
docker run -p 8080:8080 -e API_URI=http://localhost:3000 ghcr.io/spectrocloud/hello-universe:1.0.4
56
58
```
57
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
68
+
```
69
+
70
+
# Development
71
+
72
+
Create an environment file `.env` file and add the following values:
73
+
74
+
```
75
+
REACT_APP_API_URI=http://localhost:3000
76
+
REACT_APP_API_VERSION=1
77
+
```
78
+
79
+
The `.env` file is how you point to the local development API server. Otherwise, you will use the global API counter.
80
+
81
+
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`
87
+
### Development Server
88
+
To start the local development server without a proxy use the command `make start`.
89
+
90
+
### Server w/o Reverse Proxy
91
+
To start the Caddy server without a reverse proxy use the command `make start-prod`.
92
+
93
+
### Server w/o Reverse Proxy
94
+
To start the Caddy server with a reverse proxy use the command `make start-proxy`.
95
+
58
96
## Dependencies
59
97
98
+
-[Caddy](https://caddyserver.com/docs/)
60
99
-[Count API](https://countapi.xyz/) is used to keep a global count of clicks.
61
100
-[React Spring](https://github.com/pmndrs/react-spring) is used to animate the logo.
0 commit comments