Files
Mirror-Proxy/Dockerfile
T
Agent 44c8ff6a6f
Build and Push to GHCR / build-and-push (push) Has been cancelled
fix: mount config directory instead of file for Docker Compose
- Add CONFIG_PATH env support to avoid Docker creating config.json as a directory
- Config Save() now auto-creates parent directories
- Update docker-compose.yml to mount ./config:/app/config
- Update README deployment docs accordingly
2026-05-24 15:44:29 +08:00

31 lines
574 B
Docker

# 构建阶段
FROM golang:1.23-alpine AS builder
WORKDIR /app
COPY go.mod go.sum* ./
RUN go mod download 2>/dev/null || true
COPY . .
RUN go build -ldflags="-s -w" -o mirror-proxy ./cmd/main.go
# 运行阶段
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /app
# 创建必要目录
RUN mkdir -p web/static cache config
# 复制编译后的二进制文件和静态资源
COPY --from=builder /app/mirror-proxy .
COPY --from=builder /app/web/static ./web/static
# 暴露默认端口
EXPOSE 8080
VOLUME ["/app/cache"]
ENTRYPOINT ["./mirror-proxy"]