yapi-docker/Dockerfile
2022-03-16 20:00:31 +08:00

34 lines
879 B
Docker

FROM node:12-alpine as builder
ENV YAPI_VERSION="1.9.3"
ENV YAPI_HOME="/yapi"
ENV GIT_URL="https://github.com/YMFE/yapi.git"
WORKDIR ${YAPI_HOME}
RUN apk add --no-cache wget python3 make git curl
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
RUN npm install --production -registry https://registry.npm.taobao.org
WORKDIR ${YAPI_HOME}
FROM node:12-alpine
ENV TZ="Asia/Shanghai"
ENV YAPI_VERSION="1.9.3"
ENV YAPI_HOME="/yapi"
ENV ADMIN_EMAIL="master@simaek.com"
ENV DB_HOST="127.0.0.1"
ENV DB_NAME="yapi"
ENV DB_PORT="27017"
ENV MAIL_ENABLE="false"
ENV MAIL_HOST=""
ENV MAIL_PORT=""
ENV MAIL_FROM=""
ENV MAIL_USER=""
ENV MAIL_PWD=""
WORKDIR ${YAPI_HOME}
COPY --from=builder /yapi .
COPY entrypoint.sh /
RUN chmod +x /entrypoint.sh
EXPOSE 3000
ENTRYPOINT ["/entrypoint.sh"]