The Dockerfile example of the site is not working

I trying to use this:

`FROM node:18

alternatively you can use FROM strapi/base:latest

Set environment variables

ENV HOST=0.0.0.0
ENV PORT=1337
ENV NODE_ENV=production

Set up working directory

WORKDIR /

Copy package.json to root directory

COPY package.json .

Copy yarn.lock to root directory

COPY yarn.lock .

Install dependencies, but not generate a yarn.lock file and fail if an update is needed

RUN yarn install --frozen-lockfile

Copy strapi project files

COPY favicon.png ./favicon.png
COPY src/ src/
COPY public/ public/
COPY database/ database/
COPY config/ config/
COPY types/ types/
COPY .strapi/ .strapi/
COPY tsconfig.json ./tsconfig.json

Build admin panel

RUN yarn build

Run on port 1337

EXPOSE 1337

Start strapi server

CMD [“yarn”, “develop”]`

But i am getting this error:

Error: Missing jwtSecret. Please, set configuration variable "jwtSecret" ││ for the users-permissions plugin in config/plugins.js (ex: you can ││ generate one using Node with ││ crypto.randomBytes(16).toString(‘base64’)).

Can anyone help me?

This topic has been created from a Discord post (1226183378546458714) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord

jwtSecret is a required environment variable

I believe these are the minimum required env vars:

HOST=
PORT=
APP_KEYS=
API_TOKEN_SALT=
ADMIN_JWT_SECRET=
TRANSFER_TOKEN_SALT=
JWT_SECRET=

But I dont remember exactly off the top of my head

Plus the env vars for your DB of choice, ofc