2021-05-22 13:47:14 +00:00
|
|
|
FROM node:12-alpine as builder
|
|
|
|
|
2022-03-16 12:00:31 +00:00
|
|
|
ENV YAPI_VERSION="1.9.3"
|
2021-05-22 13:47:14 +00:00
|
|
|
ENV YAPI_HOME="/yapi"
|
|
|
|
ENV GIT_URL="https://github.com/YMFE/yapi.git"
|
|
|
|
WORKDIR ${YAPI_HOME}
|
2022-03-16 12:00:31 +00:00
|
|
|
RUN apk add --no-cache wget python3 make git curl
|
2021-05-22 13:47:14 +00:00
|
|
|
RUN git clone --depth 1 --branch v${YAPI_VERSION} --single-branch ${GIT_URL} vendors
|
|
|
|
WORKDIR ${YAPI_HOME}/vendors
|
|
|
|
#RUN npm install -g node-gyp yapi-cli
|
2022-03-16 12:00:31 +00:00
|
|
|
RUN npm install --production -registry https://registry.npm.taobao.org
|
|
|
|
WORKDIR ${YAPI_HOME}
|
2021-05-22 13:47:14 +00:00
|
|
|
|
|
|
|
FROM node:12-alpine
|
|
|
|
ENV TZ="Asia/Shanghai"
|
2022-03-16 12:00:31 +00:00
|
|
|
ENV YAPI_VERSION="1.9.3"
|
2021-05-22 13:47:14 +00:00
|
|
|
ENV YAPI_HOME="/yapi"
|
|
|
|
ENV ADMIN_EMAIL="master@simaek.com"
|
2022-03-16 12:00:31 +00:00
|
|
|
ENV DB_HOST="127.0.0.1"
|
2021-05-22 13:47:14 +00:00
|
|
|
ENV DB_NAME="yapi"
|
|
|
|
ENV DB_PORT="27017"
|
|
|
|
ENV MAIL_ENABLE="false"
|
2022-03-16 12:00:31 +00:00
|
|
|
ENV MAIL_HOST=""
|
|
|
|
ENV MAIL_PORT=""
|
|
|
|
ENV MAIL_FROM=""
|
|
|
|
ENV MAIL_USER=""
|
|
|
|
ENV MAIL_PWD=""
|
2021-05-22 13:47:14 +00:00
|
|
|
WORKDIR ${YAPI_HOME}
|
|
|
|
COPY --from=builder /yapi .
|
2022-03-16 12:00:31 +00:00
|
|
|
COPY entrypoint.sh /
|
|
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|