Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
pcmehrdad committed Dec 23, 2024
1 parent d5ef7bd commit 47d4f31
Show file tree
Hide file tree
Showing 7 changed files with 418 additions and 541 deletions.
25 changes: 14 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
FROM golang:1.22.5-alpine AS builder
# Install required packages and set up workspace in a single layer
RUN apk add --no-cache ca-certificates && update-ca-certificates
# Install required system packages
RUN apk update && \
apk upgrade && \
apk add --no-cache ca-certificates && \
update-ca-certificates

WORKDIR /build

# Copy all necessary files in a single layer
COPY . .
# Copy go mod and source files
COPY go.mod go.sum ./
COPY *.go ./

# Download dependencies
RUN go mod download

# Build the application
RUN go mod download && CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o proxy-server ./cmd/main.go
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o proxy-server .

# Final stage - minimal image
# Final stage
FROM scratch
WORKDIR /app

# Copy only the necessary files from builder
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
COPY --from=builder /build/proxy-server .
COPY --from=builder /build/proxies.conf ./proxies.conf
COPY --from=builder /build/users.conf ./users.conf
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/

EXPOSE 1080
CMD ["./proxy-server"]
53 changes: 0 additions & 53 deletions cmd/main.go

This file was deleted.

61 changes: 0 additions & 61 deletions internal/config/config.go

This file was deleted.

242 changes: 0 additions & 242 deletions internal/proxy_dialer/proxy_dialer.go

This file was deleted.

Loading

0 comments on commit 47d4f31

Please sign in to comment.