Dockerfile 909 B

12345678910111213141516171819
  1. FROM alpine:3.6
  2. RUN echo -e "http://mirrors.aliyun.com/alpine/v3.6/main\nhttp://mirrors.aliyun.com/alpine/v3.6/community" > /etc/apk/repositories
  3. RUN apk update && apk add --no-cache ca-certificates python3 nginx mariadb nodejs-npm git
  4. RUN apk add --no-cache --virtual .build-deps python3-dev gcc musl-dev libffi-dev openssl-dev make \
  5. && git clone https://github.com/openspug/spug.git /spug \
  6. && git pull \
  7. && pip3 install --no-cache-dir -r /spug/spug_api/requirements.txt \
  8. && pip3 install --no-cache-dir gunicorn \
  9. && apk del .build-deps
  10. RUN cd /spug/spug_web/ && npm i -d --registry=https://registry.npm.taobao.org \
  11. && npm run build \
  12. && mv /var/lib/nginx/html /var/lib/nginx/html.bak && mv /spug/spug_web/dist /var/lib/nginx/html
  13. ADD default.conf /etc/nginx/conf.d/default.conf
  14. ADD entrypoint.sh /entrypoint.sh
  15. ADD scripts /scripts
  16. ENTRYPOINT ["sh", "/entrypoint.sh"]