Initial commit with basic example

This commit is contained in:
Mike Conrad
2025-05-30 09:55:44 -04:00
commit f26a2fad95
4 changed files with 227 additions and 0 deletions

26
proxy/Dockerfile Normal file
View File

@ -0,0 +1,26 @@
# Stage 1: Build the Go binary
FROM golang:1.24.2-alpine AS builder
# Set working directory inside the build container
WORKDIR /app
# Copy Go module files and source code
COPY go.mod ./
RUN go mod download
COPY . .
# Build the Go binary statically
RUN CGO_ENABLED=0 GOOS=linux go build -o docker-api-proxy .
# Stage 2: Run binary in minimal container
FROM scratch
# Copy binary from builder
COPY --from=builder /app/docker-api-proxy /usr/local/bin/docker-api-proxy
# Run binary
ENTRYPOINT ["docker-api-proxy"]
# Default port
EXPOSE 80