加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 861 Bytes
一键复制 编辑 原始数据 按行查看 历史
crudapi 提交于 2022-11-22 18:20 . FROM node:14-alpine as builder
FROM node:14-alpine as builder
RUN apk add jq
COPY package.json /crudapi-admin-web/package.json
WORKDIR /crudapi-admin-web
RUN npm install
COPY . /crudapi-admin-web/
WORKDIR /crudapi-admin-web
RUN npm run build && \
version=`cat package.json | jq .version | sed 's/\"//g'` && \
echo $version && \
mkdir -p /crudapi/dist/crudapi-admin-web/$version && \
cd ./dist/spa && \
tar -zcvf crudapi-admin-web-$version.tar.gz crudapi && \
cp ./crudapi-admin-web-$version.tar.gz /crudapi/dist/crudapi-admin-web/$version && \
rm -rf crudapi-admin-web-$version.tar.gz
FROM nginx:latest
WORKDIR /crudapi-admin-web
COPY --from=builder /crudapi-admin-web/dist/spa .
COPY --from=builder /crudapi/dist /crudapi/dist/
COPY ./docker/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
COPY run.sh run.sh
CMD ["/crudapi-admin-web/run.sh"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化