xjf666 commited on
Commit
d8e2520
·
verified ·
1 Parent(s): 82d22fc

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +37 -0
Dockerfile ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM node:18-alpine3.18 AS deps
2
+ WORKDIR /app
3
+
4
+ RUN apk add --no-cache git python3 make g++
5
+
6
+ RUN git clone https://github.com/tangly1024/NotionNext.git .
7
+
8
+ RUN yarn install --frozen-lockfile
9
+
10
+ FROM node:18-alpine3.18 AS builder
11
+ WORKDIR /app
12
+
13
+ COPY --from=deps /app ./
14
+
15
+ ARG NOTION_PAGE_ID
16
+ ARG NEXT_PUBLIC_THEME
17
+
18
+ RUN yarn build
19
+
20
+ FROM node:18-alpine3.18 AS runner
21
+ WORKDIR /app
22
+
23
+ ENV NODE_ENV=production
24
+ ENV NOTION_PAGE_ID=${NOTION_PAGE_ID}
25
+ ENV NEXT_PUBLIC_THEME=${NEXT_PUBLIC_THEME}
26
+ ENV PORT=7860
27
+
28
+ COPY --from=builder /app ./
29
+
30
+ USER root
31
+ RUN chown -R node:node /app
32
+
33
+ USER node
34
+
35
+ EXPOSE $PORT
36
+
37
+ CMD ["sh", "-c", "yarn start -p $PORT -H 0.0.0.0"]