1、Dockerfile
FROM node:9.2-alpine as builder
RUN apk add --no-cache git python make openssl tar gcc
ADD yapi.tgz /home/
RUN mkdir /api && mv /home/package /api/vendors
RUN cd /api/vendors && \
npm install --production --registry https://registry.npm.taobao.org
FROM node:9.2-alpine
MAINTAINER u5de6a
ENV TZ="Asia/Shanghai" HOME="/"
WORKDIR ${HOME}
COPY --from=builder /api/vendors /api/vendors
COPY config.json /api/
EXPOSE 3000
ENTRYPOINT ["node"]
2、config.json
{
"port": "3000",
"adminAccount": "yapi@administrator",
"db": {
"servername": "mongo",
"DATABASE": "yapi",
"port": 27017
}
}
3、build.sh
echo -e "\033[32m download new package (version $1) \033[0m"
wget -O yapi.tgz http://registry.npm.taobao.org/yapi-vendor/download/yapi-vendor-$1.tgz
echo -e "\033[32m build new image \033[0m"
docker build -t <your docker repository>yapi .
4、build
./build.sh <Version>
Content type
Image
Digest
Size
43.1 MB
Last updated
about 7 years ago
docker pull u5de6a/yapi