[add] Forcing proxy refresh on container run
This commit is contained in:
parent
9ed011d4ad
commit
978c0ecd19
2
.dockerignore
Normal file
2
.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
proxies.txt
|
||||||
|
.git/
|
18
Dockerfile
18
Dockerfile
@ -1,3 +1,4 @@
|
|||||||
|
# Build stage
|
||||||
FROM golang:1.15-alpine AS build
|
FROM golang:1.15-alpine AS build
|
||||||
|
|
||||||
ARG VERSION
|
ARG VERSION
|
||||||
@ -13,8 +14,23 @@ RUN go mod download
|
|||||||
RUN go build -ldflags "-s -w -X ktbs.dev/mubeng/common.Version=${VERSION}" \
|
RUN go build -ldflags "-s -w -X ktbs.dev/mubeng/common.Version=${VERSION}" \
|
||||||
-o ./bin/mubeng ./cmd/mubeng
|
-o ./bin/mubeng ./cmd/mubeng
|
||||||
|
|
||||||
|
# Production build
|
||||||
FROM python:3.10-alpine3.16
|
FROM python:3.10-alpine3.16
|
||||||
|
|
||||||
COPY --from=build /app/bin/mubeng /bin/mubeng
|
COPY --from=build /app/bin/mubeng /bin/mubeng
|
||||||
|
|
||||||
|
# Installing the python scripts
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY requirements.txt /app
|
||||||
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
COPY scrape_proxies.py /app
|
||||||
|
|
||||||
|
COPY entrypoint.sh /app
|
||||||
|
|
||||||
ENV HOME /
|
ENV HOME /
|
||||||
ENTRYPOINT ["/bin/mubeng"]
|
|
||||||
|
VOLUME /mubeng/
|
||||||
|
|
||||||
|
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||||
|
@ -6,6 +6,4 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
volumes:
|
# command: '--check --address 0.0.0.0:8080 --rotate 1 --method random --file /mubeng/proxies.txt --watch --timeout 10s'
|
||||||
- .:/mubeng
|
|
||||||
command: '--check --address 0.0.0.0:8080 --rotate 1 --method random --file /mubeng/proxies.txt --watch --timeout 10s'
|
|
||||||
|
5
entrypoint.sh
Executable file
5
entrypoint.sh
Executable file
@ -0,0 +1,5 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
python3 /app/scrape_proxies.py | tee /mubeng/proxies.txt
|
||||||
|
|
||||||
|
/bin/mubeng --check --address 0.0.0.0:8080 --rotate 1 --method random --file /mubeng/proxies.txt --watch --timeout 10s
|
Loading…
Reference in New Issue
Block a user