Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmehrdad authored Jan 27, 2025
1 parent b9f8d7c commit 1f2be61
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Stage 1: Build the Go application
FROM golang:1.22.5-alpine AS builder
# Install required system packages
RUN apk update && \
Expand All @@ -18,20 +17,11 @@ RUN go mod download
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o proxy-server .

# Stage 2: Build the nc binary
FROM alpine:latest AS nc-builder
RUN apk add --no-cache netcat-openbsd

# Stage 3: Final scratch image
# Final stage
FROM scratch
WORKDIR /app

# Copy the Go binary and CA certificates
COPY --from=builder /build/proxy-server .
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

# Copy the nc binary from the nc-builder stage
COPY --from=nc-builder /usr/bin/nc /bin/nc

EXPOSE 1080
CMD ["./proxy-server"]

0 comments on commit 1f2be61

Please sign in to comment.