-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0973696
commit d933b23
Showing
2 changed files
with
21 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,19 @@ | ||
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 | ||
FROM node:20-slim | ||
RUN apt update && apt install python3 -y && apt clean && npm install -g pnpm | ||
ARG NOTION_PAGE_ID | ||
WORKDIR /app | ||
COPY . . | ||
COPY --from=deps /app/node_modules ./node_modules | ||
RUN yarn build | ||
RUN rm -rf node_modules | ||
RUN pnpm install --frozen-lockfile && pnpm install sharp | ||
RUN pnpm run build | ||
|
||
ENV NODE_ENV production | ||
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 | ||
ENV NEXT_TELEMETRY_DISABLED=1 | ||
|
||
CMD ["yarn", "start"] | ||
CMD ["pnpm", "run", "start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
version: '3.8' | ||
|
||
services: | ||
server: | ||
build: | ||
context: . | ||
args: | ||
NOTION_PAGE_ID: your_notion_page_id | ||
restart: always | ||
ports: | ||
- 3000:3000 | ||
environment: | ||
NOTION_PAGE_ID: your_notion_page_id |