-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
37 lines (25 loc) · 979 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
FROM golang:1.20.5-bullseye
#ENV GOPROXY=https://goproxy.cn,direct
WORKDIR /app
RUN apt-get update && apt-get install -y git && git clone https://github.com/wulabing/justmysocks_exporter.git .
RUN go mod download && go build -v -o justmysocks_exporter . && chmod +x justmysocks_exporter
FROM debian:bullseye-slim
WORKDIR /app
COPY --from=0 /app/justmysocks_exporter .
RUN apt-get update && apt-get install -y ca-certificates
EXPOSE 10001
ENV API_ADDRESS="https://justmysocks5.net/members/getbwcounter.php" \
SERVICE="" \
ID="" \
UPDATE_INTERVAL="5m"
# docker run -p 10001:10001 -e SERVICE="your-service-number" -e ID="your-uuid" your-image-name
#CMD ["./justmysocks_exporter", \
# "-api-address=${API_ADDRESS}", \
# "-service=${SERVICE}", \
# "-id=${ID}", \
# "-update-interval=${UPDATE_INTERVAL}"]
CMD ./justmysocks_exporter \
-api-address=$API_ADDRESS \
-service=$SERVICE \
-id=$ID \
-update-interval=$UPDATE_INTERVAL