forked from danilofalcao/cursor-deepseek
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (32 loc) · 926 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
38
39
40
41
42
43
44
45
# Build stage
FROM golang:1.21-alpine AS builder
# Add build argument to specify which proxy to build
ARG PROXY_VARIANT=deepseek
# Install necessary build tools
RUN apk add --no-cache git
# Set working directory
WORKDIR /app
# Copy go mod files first for better caching
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
# Copy source files
COPY . .
# Build the application based on the selected variant
RUN if [ "$PROXY_VARIANT" = "openrouter" ]; then \
CGO_ENABLED=0 GOOS=linux go build -o proxy proxy-openrouter.go; \
else \
CGO_ENABLED=0 GOOS=linux go build -o proxy proxy.go; \
fi
# Final stage
FROM alpine:latest
# Install ca-certificates for HTTPS requests
RUN apk --no-cache add ca-certificates
# Set working directory
WORKDIR /app
# Copy the binary from builder
COPY --from=builder /app/proxy .
# Expose port 9000
EXPOSE 9000
# Run the application
CMD ["./proxy"]