File tree Expand file tree Collapse file tree 5 files changed +65
-26
lines changed Expand file tree Collapse file tree 5 files changed +65
-26
lines changed Original file line number Diff line number Diff line change @@ -130,4 +130,6 @@ dmypy.json
130130# Pyre type checker
131131.pyre /
132132
133- proxypool /.env
133+ proxypool /.env
134+ .DS_Store
135+ .vscode
Original file line number Diff line number Diff line change @@ -2,22 +2,43 @@ name: build
22on :
33 push :
44 branches :
5- - master
5+ - master
66 paths-ignore :
7- - .gitignore
8- - README.md
9- - ' .github/ISSUE_TEMPLATE/**'
7+ - .gitignore
8+ - README.md
9+ - ' .github/ISSUE_TEMPLATE/**'
10+ release :
11+ types : [published]
12+
1013jobs :
1114 build :
1215 runs-on : ubuntu-latest
1316 steps :
14- - name : Checkout Source
15- uses : actions/checkout@v1
16- - name : Docker Login
17- run : docker login -u germey -p ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }}
18- - name : Build the Docker Image
19- run : docker-compose -f build.yaml build
20- - name : Tag and Push Master Version
21- run : |
22- docker push germey/proxypool:master
23-
17+ - name : Checkout
18+ uses : actions/checkout@v2
19+
20+ - name : Set up QEMU
21+ uses : docker/setup-qemu-action@v1
22+
23+ - name : Set up Docker Buildx
24+ uses : docker/setup-buildx-action@v1
25+
26+ - name : Login to DockerHub
27+ uses : docker/login-action@v1
28+ with :
29+ username : germey
30+ password : ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }}
31+
32+ - name : Extract branch name
33+ id : branch
34+ shell : bash
35+ run : echo "##[set-output name=tag;]$(echo ${GITHUB_REF##*/} | sed 's/master/latest/')"
36+
37+ - name : Build and push
38+ uses : docker/build-push-action@v2
39+ with :
40+ context : .
41+ push : true
42+ platforms : linux/amd64
43+ tags : |
44+ germey/proxypool:${{ steps.branch.outputs.tag }}
Original file line number Diff line number Diff line change 33* .db
44venv
55/.idea
6- * .log
6+ * .log
7+ .DS_Store
Original file line number Diff line number Diff line change 1- FROM alpine:3.7
2- WORKDIR /app
3- RUN apk add --no-cache --virtual .build-deps g++ python3-dev libffi-dev \
4- openssl-dev libxml2-dev libxslt-dev gcc musl-dev py3-pip && \
5- apk add --no-cache --update python3 && \
6- pip3 install --upgrade pip setuptools
1+ FROM python:3.7-alpine AS build
72COPY requirements.txt .
8- RUN pip3 install -r requirements.txt && \
9- apk del g++ gcc musl-dev libxml2-dev
3+ RUN apk update &&\
4+ apk add --no-cache gcc g++ libffi-dev openssl-dev libxml2-dev libxslt-dev &&\
5+ pip install --timeout 30 --user --no-cache-dir --no-warn-script-location -r requirements.txt
6+
7+ FROM python:3.7-alpine
8+ ENV APP_ENV=prod
9+ ENV LOCAL_PKG="/root/.local"
10+ COPY --from=build ${LOCAL_PKG} ${LOCAL_PKG}
11+ RUN apk update && apk add --no-cache libffi-dev openssl-dev libxslt-dev &&\
12+ ln -sf ${LOCAL_PKG}/bin/* /usr/local/bin/
13+ WORKDIR /app
1014COPY . .
11- # RUN pip install -r requirements.txt -i https://pypi.douban.com/simple
15+ EXPOSE 5555
1216VOLUME ["/app/proxypool/crawlers/private" ]
13- CMD ["supervisord" , "-c" , "supervisord.conf" ]
17+ ENTRYPOINT ["supervisord" , "-c" , "supervisord.conf" ]
Original file line number Diff line number Diff line change 1+ [unix_http_server]
2+ file=/run/supervisor.sock
3+ chmod=0700
4+
15[supervisord]
6+ pidfile=/run/supervisord.pid
27nodaemon=true
38
9+ [supervisorctl]
10+ serverurl=unix:///run/supervisor.sock
11+
12+ [rpcinterface:supervisor]
13+ supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface
14+
415[program:tester]
516process_name=tester
617command=python3 run.py --processor tester
You can’t perform that action at this time.
0 commit comments