Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0686527

Browse files
author
Germey
committed
Merge branch 'master' of github.com:Python3WebSpider/ProxyPool
2 parents 8a21396 + 642a595 commit 0686527

File tree

5 files changed

+65
-26
lines changed

5 files changed

+65
-26
lines changed

‎.dockerignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff 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

‎.github/workflows/build.yml

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,43 @@ name: build
22
on:
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+
1013
jobs:
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 }}

‎.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
*.db
44
venv
55
/.idea
6-
*.log
6+
*.log
7+
.DS_Store

‎Dockerfile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
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
72
COPY 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
1014
COPY . .
11-
# RUN pip install -r requirements.txt -i https://pypi.douban.com/simple
15+
EXPOSE 5555
1216
VOLUME ["/app/proxypool/crawlers/private"]
13-
CMD ["supervisord", "-c", "supervisord.conf"]
17+
ENTRYPOINT ["supervisord", "-c", "supervisord.conf"]

‎supervisord.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
1+
[unix_http_server]
2+
file=/run/supervisor.sock
3+
chmod=0700
4+
15
[supervisord]
6+
pidfile=/run/supervisord.pid
27
nodaemon=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]
516
process_name=tester
617
command=python3 run.py --processor tester

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /