From 1d71fdaa6a4084ecaab5dcb5cc4ddc55783374f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samy=20Pess=C3=A9?= Date: Thu, 14 Nov 2024 13:10:11 +0100 Subject: [PATCH] Start --- Dockerfile | 25 +++++++++++++++++++++++++ package.json | 3 ++- packages/gitbook/next.config.js | 2 ++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..8217869bb --- /dev/null +++ b/Dockerfile @@ -0,0 +1,25 @@ +# Use the official Node.js image as the base image +FROM imbios/bun-node:latest + +# Set the working directory inside the container +WORKDIR /app + +# Copy the package.json and bun.lockb files to the working directory +COPY . . + +# Install the app dependencies +RUN bun install --frozen-lockfile + +# Next.js collects completely anonymous telemetry data about general usage. +# Learn more here: https://nextjs.org/telemetry +# Disable telemetry during the build +ENV NEXT_TELEMETRY_DISABLED 1 +RUN bun run build + +# Expose the port on which the app will run +EXPOSE 3000 + +# Start the app +ENV PORT 3000 +ENV HOSTNAME "0.0.0.0" +CMD ["bun", "run", "start"] \ No newline at end of file diff --git a/package.json b/package.json index fee8f7e95..c4db7cc26 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,8 @@ "release": "turbo run release && changeset publish", "release:preview": "turbo run release:preview", "download:env": "op read op://gitbook-x-dev/gitbook-open/.env.local >> .env.local", - "clean": "turbo run clean" + "clean": "turbo run clean", + "start": "cd packages/gitbook && bun run start" }, "workspaces": [ "packages/*" diff --git a/packages/gitbook/next.config.js b/packages/gitbook/next.config.js index b5f1f42d6..d4a67df8e 100644 --- a/packages/gitbook/next.config.js +++ b/packages/gitbook/next.config.js @@ -2,6 +2,8 @@ const { withSentryConfig } = require('@sentry/nextjs'); module.exports = withSentryConfig( { + output: 'standalone', + env: { BUILD_VERSION: (process.env.GITHUB_SHA ?? '').slice(0, 7), SENTRY_DSN: process.env.SENTRY_DSN ?? '',