mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-14 15:09:22 +00:00
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
||||
.next*
|
||||
27
Dockerfile
Normal file
27
Dockerfile
Normal file
@@ -0,0 +1,27 @@
|
||||
ARG NOTION_PAGE_ID
|
||||
# Install dependencies only when needed
|
||||
FROM node:14-alpine AS deps
|
||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
||||
RUN apk add --no-cache libc6-compat
|
||||
WORKDIR /app
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install --frozen-lockfile
|
||||
|
||||
# Rebuild the source code only when needed
|
||||
FROM node:14-alpine AS builder
|
||||
ARG NOTION_PAGE_ID
|
||||
WORKDIR /app
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
RUN yarn build
|
||||
|
||||
ENV NODE_ENV production
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
# Next.js collects completely anonymous telemetry data about general usage.
|
||||
# Learn more here: https://nextjs.org/telemetry
|
||||
# Uncomment the following line in case you want to disable telemetry.
|
||||
# ENV NEXT_TELEMETRY_DISABLED 1
|
||||
|
||||
CMD ["yarn", "start"]
|
||||
11
README.md
11
README.md
@@ -72,6 +72,17 @@
|
||||
|
||||
## 快速开发
|
||||
|
||||
- 通过Docker体验本地部署
|
||||
```bash
|
||||
# 从Dockerhub仓库中下载体验
|
||||
docker pull tangly1024/notionnext:2.8.1
|
||||
docker run -p 3000:3000 tangly1024/notionnext:2.8.1
|
||||
# 可以在环境变量中直接配置NOTION_PAGE_ID
|
||||
docker run -p 3000:3000 -e NOTION_PAGE_ID="你的Notion_Page_ID" tangly1024/notionnext:2.8.1
|
||||
|
||||
```
|
||||
|
||||
- 本地安装Nodejs进行开发
|
||||
```bash
|
||||
yarn # 安装依赖
|
||||
yarn run dev # 本地开发
|
||||
|
||||
Reference in New Issue
Block a user