Skip to content

Commit

Permalink
Update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanelian committed Oct 7, 2022
1 parent be0c422 commit dfae8e6
Showing 1 changed file with 42 additions and 12 deletions.
54 changes: 42 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@

- Enabled container builds on GitLab CI or GitHub CI

- Batteries included: `jotai`, Bootstrap 5, `antd`, FontAwesome 5
- Batteries included: `jotai`, Bootstrap 5, `antd`, FontAwesome 5, `react-hook-form`

- Provide sane defaults for the most common security headers

## Getting Started

Expand Down Expand Up @@ -161,6 +163,28 @@ For custom advanced configuration of Next.js (such as webpack), `next.config.js`
> Read more about custom webpack configuration: https://nextjs.org/docs/api-reference/next.config.js/custom-webpack-config
## Building and Running Production Build

```sh
npm run build
```

```sh
npx cross-env \
NODE_ENV='production' \
NEXTAUTH_URL='http://localhost' \
NEXTAUTH_SECRET='e01b7895a403fa7364061b2f01a650fc' \
BACKEND_API_HOST='https://demo.duendesoftware.com' \
OIDC_ISSUER='https://demo.duendesoftware.com' \
OIDC_CLIENT_ID='interactive.public.short' \
OIDC_SCOPE='openid profile email api offline_access' \
npm run start
```

> **DO NOT FORGET** to randomize `NEXTAUTH_SECRET` value for Production Environment with https://generate-secret.vercel.app/32 or `openssl rand -base64 32`
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/).

## Building and Running as Container

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)
Expand All @@ -183,19 +207,21 @@ docker network create my-network

```sh
docker run \
-e NEXTAUTH_URL="https://www.my-website.com" \
-e NEXTAUTH_SECRET="e01b7895a403fa7364061b2f01a650fc" \
-e BACKEND_API_HOST="https://demo.duendesoftware.com" \
-e OIDC_ISSUER="https://demo.duendesoftware.com" \
-e OIDC_CLIENT_ID="interactive.public.short" \
-e OIDC_SCOPE="openid profile email api offline_access" \
-p 80:80 \
--network my-network \
--restart always \
--name my-container \
-d my-app
-e NEXTAUTH_URL="https://www.my-website.com" \
-e NEXTAUTH_SECRET="e01b7895a403fa7364061b2f01a650fc" \
-e BACKEND_API_HOST="https://demo.duendesoftware.com" \
-e OIDC_ISSUER="https://demo.duendesoftware.com" \
-e OIDC_CLIENT_ID="interactive.public.short" \
-e OIDC_SCOPE="openid profile email api offline_access" \
-p 80:80 \
--network my-network \
--restart always \
--name my-container \
-d my-app
```

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

[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).
Expand Down Expand Up @@ -450,6 +476,10 @@ spec:
> TODO
## Security Headers
> TODO
## Step Debugging with Visual Studio Code
This template ships with Visual Studio Code step debugging support. Simply press F5 to start debugging.
Expand Down

0 comments on commit dfae8e6

Please sign in to comment.