@@ -8,11 +8,12 @@ Simple WebApp (SPA) using [esbuild](https://esbuild.github.io/), [jsx-dom](https
8
8
# 📑 Requirements
9
9
* [ NodeJS] ( https://nodejs.org/ ) or similar javascript engine
10
10
* [ Docker] ( https://www.docker.com/ ) or similar container engine
11
+ * [ Helm] ( https://helm.sh/ ) for deploying to [ Kubernetes] ( https://kubernetes.io/ )
11
12
12
13
# 🏗️ Structure
13
- All source-files for the app resides in ` src ` folder.
14
- Where the ` src/main/app.jsx ` file is your main entry point for ` esbuild ` .
15
- Any custom css goes into the ` app.css ` file and any static resource (e.g. html, ico, etc.) goes into the ` src/resource ` folder. That's all! 😉
14
+ All source-files for the app resides in ` ./ src` folder.
15
+ Where the ` ./ src/main/app.jsx` file is your main entry point for ` esbuild ` .
16
+ Any custom css goes into the ` app.css ` file and any static resource (e.g. html, ico, etc.) goes into the ` ./ src/resource` folder. That's all! 😉
16
17
17
18
# 🛠️ Build App (for Production)
18
19
Just run ` make ` or following commands
@@ -30,41 +31,53 @@ npm install
30
31
node build.mjs serve
31
32
```
32
33
33
- # 🐋 Run Docker App
34
- Just run ` make run ` or following commands
34
+ # 🐋 Docker
35
+ ## Run Docker Container
36
+ Just run ` make docker_run ` or following command
35
37
```
36
38
docker run --name ${NAME} -dt --rm --init -p ${PORT}:3000 ${NAME}:latest
37
39
```
40
+ Alternatively, you can also use ` docker compose up ` to start the container, by using the ` ./docker-compose.yaml ` .
38
41
39
- Alternatively, you can also use ` docker compose up ` to start the container,
40
- by using the ` docker-compose.yaml ` .
41
-
42
- # 🐋 Stop Docker App
43
- Just run ` make stop ` or following commands
42
+ ## Stop Docker Container
43
+ Just run ` make docker_stop ` or following command
44
44
```
45
45
docker container stop ${NAME}
46
46
```
47
47
48
- # Run on Kubernetes with Helm
49
- There is also a helm chart provided under ` ./helm ` directory.
48
+ Or use ` docker compose stop ` to stop the container, when using the ` ./docker-compose.yaml ` .
49
+
50
+ # ☸️ Kubernetes
51
+ ## Run Kubernetes Pod
52
+ There is a helm chart provided under ` ./helm ` directory.
53
+
54
+ Just run ` make helm_install ` or following command
55
+ ```
56
+ helm upgrade --install --wait --create-namespace --namespace ${NAME} ${NAME} ./helm
57
+ ```
50
58
59
+ ## Stop Kubernetes Pod
60
+ Just run ` make helm_uninstall ` or following command
61
+ ```
62
+ helm uninstall --namespace ${NAME} ${NAME}
63
+ ```
51
64
52
65
# ⚙️ Github Release + Package
53
- Whenever a commit gets pushed to the ` main ` branch a workflow gets triggered, which builds the app.
54
- When a commit gets tagged with ` v*.* ` notation (e.g. ` v1.0 ` ) the action created a Github release
55
- and push the Docker Image to the Github Container Registry (ghcr.oi).
66
+ Whenever a new commit is pushed on the ` main ` branch or a pull request is created, the Github workflow gets triggered.
67
+ The workflow (` ./.github/workflows/buildAndRelease.yaml ` ) builds the app, Docker image and Helm chart.
68
+
69
+ To create a Github Release and publish the app, Docker image and Helm chart,
70
+ you only have to tag the specific commit with ` *.*.* ` notation ([ SemanticVersion] ( https://semver.org/ ) ).
56
71
57
- Just run ` make release version=v1 .0 ` or following commands
72
+ Just run ` make release version=1.0 .0 ` or following commands
58
73
```
59
74
git tag v1.0
60
75
git push origin tag v1.0
61
76
```
62
77
63
78
It is also possible to delete a release.
64
- Just run ` make delete_release version=v1 .0 ` or following commands
79
+ Just run ` make release_delete version=1.0 .0 ` or following commands
65
80
```
66
81
git tag -d v1.0
67
82
git push --delete origin v1.0
68
- ```
69
-
70
- # ☸️ Kubernetes
83
+ ```
0 commit comments