You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitlink_help_center/Dockerfile

39 lines
887 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

# 使用官方Node.js镜像作为基础镜像
FROM node:18-alpine
LABEL maintainer="hejiayu <hejy47@nudt.edu.cn>"
# 设置工作目录
WORKDIR /gitlink_help_center
# 设置npm和yarn使用淘宝镜像源加快依赖安装速度
RUN npm config set registry https://registry.npmmirror.com && \
yarn config set registry https://registry.npmmirror.com
# 安装构建依赖
RUN apk add --no-cache python3 make g++
# 复制package.json和yarn.lock
COPY package.json yarn.lock ./
# 安装依赖
RUN yarn install --frozen-lockfile
# 复制静态资源
COPY static ./static
COPY versioned_docs ./versioned_docs
COPY src ./src
COPY docusaurus.config.js ./
COPY sidebars.js ./
COPY versions.json ./
# 更新browserslist数据库
RUN npx update-browserslist-db@latest
# 构建项目
RUN yarn build --locale zh-cn
# 暴露端口
EXPOSE 3000
# 启动命令
CMD ["npm", "run", "serve"]