tesaibottelegramdukun / Dockerfile
ibaaaaal
fix: copy source before go mod tidy
5368f37
Raw History Blame Contribute Delete
530 Bytes
# Build stage
FROM golang:1.21-alpine AS builder
WORKDIR /app
# Install git for go mod download
RUN apk add --no-cache git
# Copy all source files first
COPY go.mod ./
COPY *.go ./
# Download dependencies based on actual imports
RUN go mod tidy && go mod download
# Build
RUN CGO_ENABLED=0 GOOS=linux go build -o imgprocessor .
# Runtime stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates
WORKDIR /root/
COPY --from=builder /app/imgprocessor .
# HF Spaces uses port 7860
EXPOSE 7860
CMD ["./imgprocessor"]