Preset: koyeb
start command to your package.json file, under the Build and deployment settings, toggle the override switch associated with the run command field. In the Run command field, enter:node .output/server/index.mjs`
NITRO_PRESET variable set to koyeb.koyeb login
<APPLICATION_NAME>, <YOUR_GITHUB_USERNAME>, and <YOUR_REPOSITORY_NAME>:koyeb app init <APPLICATION_NAME> \
--git github.com/<YOUR_GITHUB_USERNAME>/<YOUR_REPOSITORY_NAME> \
--git-branch main \
--git-run-command "node .output/server/index.mjs" \
--ports 3000:http \
--routes /:3000 \
--env PORT=3000 \
--env NITRO_PRESET=koyeb
.dockerignore file in the root of your project and add the following lines:Dockerfile
.dockerignore
node_modules
npm-debug.log
.nitro
.output
.git
dist
README.md
Dockerfile to the root of your project:FROM node:18-alpine AS base
FROM base AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
FROM base AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build && npm cache clean --force
FROM base AS runner
WORKDIR /app
RUN addgroup --system --gid 1001 nodejs
RUN adduser --system --uid 1001 nitro
COPY --from=builder /app .
USER nitro
EXPOSE 3000
ENV PORT 3000
CMD ["npm", "run", "start"]
The Dockerfile above provides the minimum requirements to run the Nitro application. You can easily extend it depending on your needs. You will then need to push your Docker image to a registry. You can use Docker Hub or GitHub Container Registry for example. In the Koyeb control panel, use the image and the tag field to specify the image you want to deploy. You can also use the Koyeb CLI Refer to the Koyeb Docker documentation for more information.