master镜像nginx启动失败

Break change:
 Dockerfile.alpine -> Dockerfile.master.alpine

Feture:
  增加Dockerfile.worker.alpine 文件
This commit is contained in:
yaziming
2019-08-15 11:49:17 +08:00
parent 4a2ebe3b2e
commit c3cbc047b1
2 changed files with 45 additions and 4 deletions

View File

@@ -27,10 +27,6 @@ ADD . /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# install packages
#RUN apt-get update \
# && apt-get install -y curl git net-tools iputils-ping ntp ntpdate python3 python3-pip \
# && ln -s /usr/bin/pip3 /usr/local/bin/pip \
# && ln -s /usr/bin/python3 /usr/local/bin/python
RUN apk update && apk add --no-cache --virtual .build-deps \
gcc \
linux-headers \
@@ -55,6 +51,8 @@ RUN apk del .build-deps
COPY --from=frontend-build /app/dist /app/dist
COPY --from=frontend-build /app/conf/crawlab.conf /etc/nginx/conf.d
VOLUME [ /sys/fs/cgroup ]
RUN sed -i 's/#rc_sys=""/rc_sys="lxc"/g' /etc/rc.conf && \
echo 'rc_provide="loopback net"' >> /etc/rc.conf && \
sed -i 's/^#\(rc_logger="YES"\)$/\1/' /etc/rc.conf && \

43
Dockerfile.worker.apline Normal file
View File

@@ -0,0 +1,43 @@
FROM golang:1.12-alpine AS backend-build
WORKDIR /go/src/app
COPY ./backend .
ENV GO111MODULE on
ENV GOPROXY https://mirrors.aliyun.com/goproxy/
RUN go install -v ./...
# images
FROM python:alpine
ADD . /app
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update && apk add --no-cache --virtual .build-deps \
gcc \
linux-headers \
musl-dev \
libffi-dev \
libxml2-dev \
libxslt-dev \
openssl-dev
# install backend
RUN pip install scrapy pymongo bs4 requests -i https://pypi.tuna.tsinghua.edu.cn/simple
# copy backend files
COPY --from=backend-build /go/src/app/conf ./conf
COPY --from=backend-build /go/bin/crawlab /usr/local/bin
RUN apk del .build-deps
# working directory
WORKDIR /app/backend
# backend port
EXPOSE 8000
# start backend
CMD crawlab