Skip to content

Commit 5d984c2

Browse files
committed
Update first release deployment configs
1 parent 6bd929b commit 5d984c2

File tree

8 files changed

+78
-8
lines changed

8 files changed

+78
-8
lines changed

.env.example

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
NODE_ENV=production
2+
VITE_MODE=production
3+
4+
APP_PORT=8181
5+
6+
VITE_API_BASE_URL=http://127.0.0.1:4242
7+
8+
VITE_KEYCLOAK_URL=http://localhost:8080/
9+
VITE_KEYCLOAK_REALM=dev
10+
VITE_KEYCLOAK_CLIENT_ID=bff-dashboard

.env.production

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VITE_API_BASE_URL=http://127.0.0.1:3338
1+

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,3 +28,4 @@ coverage/
2828
tsconfig.app.tsbuildinfo
2929
tsconfig.node.tsbuildinfo
3030
*storybook.log
31+
.env

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# 0.1.0
2+
3+
* Initial version

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ARG NODE_ENV
22
ARG VITE_MODE
33

4-
FROM node:22.11.0-slim@sha256:f035ba7ffee18f67200e2eb8018e0f13c954ec16338f264940f701997e3c12da AS builder
4+
FROM node:24.2.0-slim AS builder
55
ARG NODE_ENV
66
ARG VITE_MODE
77
ENV NODE_ENV=${NODE_ENV:-production}
@@ -11,13 +11,13 @@ WORKDIR /app
1111

1212
COPY package*.json ./
1313

14-
RUN npm install --no-fund --no-audit
14+
RUN npm install --no-fund --no-audit --include=dev
1515

1616
COPY . .
1717

1818
RUN npm run build -- --mode=${VITE_MODE}
1919

20-
FROM nginx:1.27.4-alpine@sha256:4ff102c5d78d254a6f0da062b3cf39eaf07f01eec0927fd21e219d0af8bc0591
20+
FROM nginx:1.27.5-alpine
2121

2222
COPY --from=builder /app/dist /usr/share/nginx/html
2323

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,35 @@
77
npm install
88
```
99

10-
### Run
10+
### Run Development
1111
```
1212
npm run dev
1313
```
1414

15+
### Run Docker
16+
Copy `.env.example` to `.env` and adjust
17+
```
18+
just build
19+
just run
20+
```
21+
1522
### shadcn
1623
Add a shadcn component:
1724
```shell
1825
npx shadcn@canary add button
1926
```
2027

28+
## Configuration
29+
`VITE_API_BASE_URL="http://localhost:4242"` needs to point to the Wildcat BFF Dashboard Envoy Service
30+
31+
```
32+
VITE_KEYCLOAK_URL=http://localhost:8080/
33+
VITE_KEYCLOAK_REALM=dev
34+
VITE_KEYCLOAK_CLIENT_ID=bff-dashboard
35+
```
36+
37+
These are the keycloak url and realm settings for the JWT tokens authenticated by the Wildcat Dashboard Envoy service.
38+
2139
## Resources
2240

2341
- React: https://react.dev/

docker-compose.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,21 @@
1-
21
services:
32
app:
4-
build: .
3+
build:
4+
context: .
5+
args:
6+
NODE_ENV: ${NODE_ENV}
7+
VITE_MODE: ${VITE_MODE}
58
ports:
6-
- "8080:80"
9+
- "${APP_PORT}:80"
10+
restart: unless-stopped
11+
environment:
12+
- VITE_API_BASE_URL=${VITE_API_BASE_URL}
13+
- VITE_KEYCLOAK_URL=${VITE_KEYCLOAK_URL}
14+
- VITE_KEYCLOAK_REALM=${VITE_KEYCLOAK_REALM}
15+
- VITE_KEYCLOAK_CLIENT_ID=${VITE_KEYCLOAK_CLIENT_ID}
16+
healthcheck:
17+
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80"]
18+
interval: 30s
19+
timeout: 10s
20+
retries: 3
21+
start_period: 40s

justfile

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
# print available targets
3+
[group("project-agnostic")]
4+
default:
5+
@just --list --justfile {{justfile()}}
6+
7+
# evaluate and print all just variables
8+
[group("project-agnostic")]
9+
evaluate:
10+
@just --evaluate
11+
12+
# print system information such as OS and architecture
13+
[group("project-agnostic")]
14+
system-info:
15+
@echo "architecture: {{arch()}}"
16+
@echo "os: {{os()}}"
17+
@echo "os family: {{os_family()}}"
18+
19+
build:
20+
docker build -t wildcat/dashboard -f Dockerfile .
21+
22+
run:
23+
docker compose up

0 commit comments

Comments
 (0)