Skip to content

Commit dfae8e6

Browse files
committed
Update README
1 parent be0c422 commit dfae8e6

File tree

1 file changed

+42
-12
lines changed

1 file changed

+42
-12
lines changed

README.md

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232

3333
- Enabled container builds on GitLab CI or GitHub CI
3434

35-
- Batteries included: `jotai`, Bootstrap 5, `antd`, FontAwesome 5
35+
- Batteries included: `jotai`, Bootstrap 5, `antd`, FontAwesome 5, `react-hook-form`
36+
37+
- Provide sane defaults for the most common security headers
3638

3739
## Getting Started
3840

@@ -161,6 +163,28 @@ For custom advanced configuration of Next.js (such as webpack), `next.config.js`
161163
162164
> Read more about custom webpack configuration: https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config
163165
166+
## Building and Running Production Build
167+
168+
```sh
169+
npm run build
170+
```
171+
172+
```sh
173+
npx cross-env \
174+
NODE_ENV='production' \
175+
NEXTAUTH_URL='http://localhost' \
176+
NEXTAUTH_SECRET='e01b7895a403fa7364061b2f01a650fc' \
177+
BACKEND_API_HOST='https://demo.duendesoftware.com' \
178+
OIDC_ISSUER='https://demo.duendesoftware.com' \
179+
OIDC_CLIENT_ID='interactive.public.short' \
180+
OIDC_SCOPE='openid profile email api offline_access' \
181+
npm run start
182+
```
183+
184+
> **DO NOT FORGET** to randomize `NEXTAUTH_SECRET` value for Production Environment with https://generate-secret.vercel.app/32 or `openssl rand -base64 32`
185+
186+
To use HTTPS Certificate, simply use reverse proxy such as [NGINX](https://www.nginx.com/resources/wiki/start/topics/tutorials/install/) or [Traefik](https://doc.traefik.io/traefik/getting-started/install-traefik/).
187+
164188
## Building and Running as Container
165189

166190
This template ships with `Dockerfile` and `.dockerignore` for building the app as a standard container image. To proceed, please [install Docker](https://docs.docker.com/get-docker/) or any OCI container CLI such as [`podman`](https://podman.io/) in your machine. (The examples given will use Docker)
@@ -183,19 +207,21 @@ docker network create my-network
183207

184208
```sh
185209
docker run \
186-
-e NEXTAUTH_URL="https://www.my-website.com" \
187-
-e NEXTAUTH_SECRET="e01b7895a403fa7364061b2f01a650fc" \
188-
-e BACKEND_API_HOST="https://demo.duendesoftware.com" \
189-
-e OIDC_ISSUER="https://demo.duendesoftware.com" \
190-
-e OIDC_CLIENT_ID="interactive.public.short" \
191-
-e OIDC_SCOPE="openid profile email api offline_access" \
192-
-p 80:80 \
193-
--network my-network \
194-
--restart always \
195-
--name my-container \
196-
-d my-app
210+
-e NEXTAUTH_URL="https://www.my-website.com" \
211+
-e NEXTAUTH_SECRET="e01b7895a403fa7364061b2f01a650fc" \
212+
-e BACKEND_API_HOST="https://demo.duendesoftware.com" \
213+
-e OIDC_ISSUER="https://demo.duendesoftware.com" \
214+
-e OIDC_CLIENT_ID="interactive.public.short" \
215+
-e OIDC_SCOPE="openid profile email api offline_access" \
216+
-p 80:80 \
217+
--network my-network \
218+
--restart always \
219+
--name my-container \
220+
-d my-app
197221
```
198222

223+
> **DO NOT FORGET** to randomize `NEXTAUTH_SECRET` value for Production Environment with https://generate-secret.vercel.app/32 or `openssl rand -base64 32`
224+
199225
## `AppSettings` API
200226

201227
[Next.js allows using `process.env` to read Environment Variables](https://nextjs.org/docs/basic-features/environment-variables), but it is not suitable for container-based deployment because the Environment Variables are burned during build-time (non-changeable).
@@ -450,6 +476,10 @@ spec:
450476
451477
> TODO
452478
479+
## Security Headers
480+
481+
> TODO
482+
453483
## Step Debugging with Visual Studio Code
454484
455485
This template ships with Visual Studio Code step debugging support. Simply press F5 to start debugging.

0 commit comments

Comments
 (0)