mirror of
https://github.com/isboyjc/GoProxy.git
synced 2026-05-06 20:02:54 +08:00
- Introduced `.env.example` for environment variable configuration. - Updated `docker-compose.yml` to utilize environment variables for proxy settings. - Implemented proxy authentication with Basic Auth and geo-blocking based on country codes. - Added `GEO_FILTER.md` for documentation on geo-filtering configuration. - Enhanced logging to indicate authentication status and blocked countries during proxy server startup.
26 lines
558 B
Docker
26 lines
558 B
Docker
# 构建阶段(使用完整 Debian 镜像,内置 gcc,避免 alpine apk 问题)
|
||
FROM golang:1.25 AS builder
|
||
|
||
WORKDIR /app
|
||
COPY go.mod go.sum ./
|
||
RUN go mod download
|
||
|
||
COPY . .
|
||
RUN CGO_ENABLED=1 GOOS=linux go build -o proxy-pool .
|
||
|
||
# 运行阶段(使用轻量 debian-slim)
|
||
FROM debian:bookworm-slim
|
||
|
||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||
ca-certificates tzdata && \
|
||
rm -rf /var/lib/apt/lists/*
|
||
|
||
ENV TZ=Asia/Shanghai
|
||
|
||
WORKDIR /app
|
||
COPY --from=builder /app/proxy-pool .
|
||
|
||
EXPOSE 7776 7777 7778
|
||
|
||
CMD ["./proxy-pool"]
|