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.
riskclouddocker/risk_cloud_fontend_Dockerfile

23 lines
749 B

FROM node:current-alpine
#切换阿里云镜像源
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update
#git
RUN apk add git openssh
#拷贝git密钥免密克隆仓库代码
COPY .ssh /root/.ssh
#拷贝到容器里的密钥需要修改权限才能正常使用
RUN chmod 400 /root/.ssh/id_rsa
#设置环境变量
ENV name=RiskCloudFontend
#拷贝项目文件
RUN git clone git@gogs.kirito.cool:panqihua/${name}.git
##切换到项目目录
WORKDIR /${name}
#目录读写权限
RUN chmod +x /${name} -R && pwd && ls -la
##安装依赖
RUN npm install -g cnpm --registry=https://registry.npm.taobao.org && \
cnpm install next -g && \
cnpm install && \
cnpm run build
CMD /bin/ash -c 'cnpm run start'