Skip to content

Commit

Permalink
chore(theme-default): type error
Browse files Browse the repository at this point in the history
  • Loading branch information
Mereithhh committed Mar 8, 2023
1 parent 3e98782 commit 3b02bd6
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 42 deletions.
55 changes: 30 additions & 25 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,48 +1,52 @@
# 具体每个服务的去看 packages 里面的 Dockerfile
# 这个是 all in one 的。
FROM node:18-alpine as ADMIN_BUILDER
FROM node:18-alpine as ADMIN_BUILDER
ENV NODE_OPTIONS='--max_old_space_size=4096 --openssl-legacy-provider'
ENV EEE=production
WORKDIR /app
USER root
COPY ./packages/admin/ ./
# RUN yarn config set registry https://registry.npmmirror.com
RUN yarn config set network-timeout 600000
RUN yarn global add umi
RUN yarn
# RUN sed -i 's/\/assets/\/admin\/assets/g' dist/admin/index.html
RUN yarn build
RUN apk add --update python3 make g++ && rm -rf /var/cache/apk/*
COPY ./packages/@vanblog/admin ./
RUN npm install -g pnpm
RUN pnpm config set fetch-timeout 600000
# RUN pnpm setup
# RUN pnpm install --g umi
RUN pnpm i
RUN pnpm build

FROM node:18 as SERVER_BUILDER
ENV NODE_OPTIONS=--max_old_space_size=4096
WORKDIR /app
COPY ./packages/server/ .
RUN yarn config set network-timeout 600000
RUN yarn
RUN yarn build
COPY ./packages/@vanblog/server .
RUN npm install -g pnpm
RUN pnpm config set fetch-timeout 600000
RUN pnpm i
RUN pnpm build

FROM node:16-alpine AS WEBSITE_DEPS
FROM node:18-alpine AS WEBSITE_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 ./packages/website/package.json ./packages/website/yarn.lock* ./packages/website/package-lock.json* ./packages/website/pnpm-lock.yaml* ./
RUN yarn config set network-timeout 60000 -g
COPY ./packages/@vanblog/theme-default/package.json ./packages/@vanblog/theme-default/pnpm-lock.yaml* ./
RUN npm install -g pnpm
RUN pnpm config set fetch-timeout 600000 -g
# RUN yarn config set registry https://registry.npmmirror.com -g
RUN yarn
RUN pnpm install

FROM node:16-alpine AS WEBSITE_BUILDER
FROM node:18-alpine AS WEBSITE_BUILDER
WORKDIR /app
COPY --from=WEBSITE_DEPS /app/node_modules ./node_modules
COPY ./packages/website/ .
COPY ./packages/@vanblog/theme-default/ .
ENV isBuild=t
ENV VAN_BLOG_ALLOW_DOMAINS "pic.mereith.com"
ARG VAN_BLOG_BUILD_SERVER
ENV VAN_BLOG_SERVER_URL ${VAN_BLOG_BUILD_SERVER}
ARG VAN_BLOG_VERSIONS
ENV VAN_BLOG_VERSION ${VAN_BLOG_VERSIONS}
RUN yarn config set network-timeout 60000 -g
RUN yarn config set registry https://registry.npmmirror.com -g
RUN yarn build
RUN npm install -g pnpm
RUN pnpm config set fetch-timeout 600000 -g
RUN pnpm config set registry https://registry.npmmirror.com -g
RUN pnpm build


#运行容器
Expand All @@ -52,11 +56,12 @@ RUN apk add --no-cache --update tzdata caddy nss-tools \
&& cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
&& echo "Asia/Shanghai" > /etc/timezone \
&& apk del tzdata
RUN yarn config set network-timeout 600000
RUN npm install -g pnpm
RUN pnpm config set fetch-timeout 600000
# 安装 waline
WORKDIR /app/waline
COPY ./packages/waline/ ./
RUN yarn && yarn cache clean
COPY ./packages/@vanblog/waline/ ./
RUN pnpm i
# 复制 server
WORKDIR /app/server
COPY --from=SERVER_BUILDER /app/node_modules ./node_modules
Expand All @@ -68,7 +73,7 @@ COPY --from=WEBSITE_BUILDER /app/public ./public
COPY --from=WEBSITE_BUILDER /app/package.json ./package.json
COPY --from=WEBSITE_BUILDER /app/.next/standalone ./
COPY --from=WEBSITE_BUILDER /app/.next/static ./.next/static
RUN cd /app/website && yarn add sharp && yarn cache clean --all && cd ..
RUN cd /app/website && pnpm add sharp && cd ..
ENV NODE_ENV production
ENV VAN_BLOG_SERVER_URL "http://127.0.0.1:3000"
ENV VAN_BLOG_ALLOW_DOMAINS "pic.mereith.com"
Expand Down
32 changes: 17 additions & 15 deletions packages/@vanblog/theme-default/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,23 @@
"sharp": "^0.30.7"
},
"devDependencies": {
"@swc/core": "1.3.38",
"@swc/jest": "0.2.24",
"@types/headroom.js": "0.12.2",
"@types/node": "18.14.6",
"@types/react": "18.0.28",
"@types/react-burger-menu": "2.8.3",
"@types/react-copy-to-clipboard": "5.0.4",
"@types/react-dom": "18.0.11",
"@types/react-headroom": "3.2.0",
"@types/react-scroll": "1.8.6",
"@types/react-syntax-highlighter": "15.5.6",
"autoprefixer": "10.4.13",
"postcss": "8.4.21",
"tailwindcss": "3.2.7",
"typescript": "4.9.5",
"@swc/core": "^1.3.38",
"@swc/jest": "^0.2.24",
"@types/hast": "^2.3.4",
"@types/headroom.js": "^0.12.2",
"@types/node": "17.0.35",
"@types/react": "18.0.9",
"@types/react-burger-menu": "^2.8.3",
"@types/react-copy-to-clipboard": "^5.0.3",
"@types/react-dom": "18.0.5",
"@types/react-headroom": "^2.2.2",
"@types/react-scroll": "^1.8.3",
"@types/react-syntax-highlighter": "^15.5.3",
"autoprefixer": "^10.4.7",
"cross-env": "^7.0.3",
"postcss": "^8.4.14",
"tailwindcss": "^3.1.2",
"typescript": "4.7.2",
"vitest": "0.29.2"
}
}
7 changes: 5 additions & 2 deletions packages/@vanblog/theme-default/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true
"incremental": true,
"paths": {
"react": ["./node_modules/@types/react"],
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 4 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 3b02bd6

Please sign in to comment.