Skip to content

Commit 080a320

Browse files
authored
Merge pull request craigary#157 from Vaayne/Dockerfile
add build with docker
2 parents 9e11aa2 + acca2d4 commit 080a320

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed

Dockerfile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
ARG NOTION_PAGE_ID
2+
3+
# Install dependencies only when needed
4+
FROM node:14-alpine AS deps
5+
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
6+
RUN apk add --no-cache libc6-compat
7+
WORKDIR /app
8+
COPY package.json yarn.lock ./
9+
RUN yarn install --frozen-lockfile
10+
11+
# Rebuild the source code only when needed
12+
FROM node:14-alpine AS builder
13+
ARG NOTION_PAGE_ID
14+
WORKDIR /app
15+
COPY . .
16+
COPY --from=deps /app/node_modules ./node_modules
17+
RUN yarn build
18+
19+
ENV NODE_ENV production
20+
21+
EXPOSE 3000
22+
23+
# Next.js collects completely anonymous telemetry data about general usage.
24+
# Learn more here: https://nextjs.org/telemetry
25+
# Uncomment the following line in case you want to disable telemetry.
26+
# ENV NEXT_TELEMETRY_DISABLED 1
27+
28+
CMD ["yarn", "start"]

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,22 @@ Demo: [https://nobelium.vercel.app/](https://nobelium.vercel.app/)
6666
<img src="https://github.com/craigary/nobelium/blob/main/pageid.png?raw=true">
6767
</details>
6868

69+
## Play With Docker
70+
71+
```
72+
# set env
73+
export NOTION_PAGE_ID=xxx # your NOTION_PAGE_ID
74+
export IMAGE=nobelium:latest
75+
76+
# build with docker
77+
docker build -t ${IMAGE} --build-arg NOTION_PAGE_ID .
78+
79+
# run with docker
80+
docker run -d --name nobelium -p 3000:3000 -e NOTION_PAGE_ID=${NOTION_PAGE_ID} nobelium:latest
81+
```
82+
83+
84+
6985
## Roadmap
7086

7187
Check out our roadmap [here](https://www.notion.so/craigary/Public-Roadmap-3cfc4d0f0ca642ef8f652673c37add22)

0 commit comments

Comments
 (0)