2025-05-06 16:41:05 +00:00
|
|
|
# Build stage
|
|
|
|
|
FROM golang:1.21-alpine AS builder
|
2025-05-06 16:16:42 +00:00
|
|
|
|
2025-05-06 16:41:05 +00:00
|
|
|
WORKDIR /app
|
2025-05-06 16:50:12 +00:00
|
|
|
COPY go.mod go.sum ./
|
|
|
|
|
RUN go mod download
|
2025-05-06 16:16:42 +00:00
|
|
|
|
2025-05-06 16:50:12 +00:00
|
|
|
COPY . .
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o whatsapp-sender .
|
2025-05-06 16:41:05 +00:00
|
|
|
|
|
|
|
|
# Runtime stage
|
2025-05-06 16:16:42 +00:00
|
|
|
FROM alpine:latest
|
|
|
|
|
|
2025-05-06 16:41:05 +00:00
|
|
|
WORKDIR /app
|
|
|
|
|
COPY --from=builder /app/whatsapp-sender .
|
|
|
|
|
COPY --from=builder /app/public ./public
|
|
|
|
|
|
2025-05-06 16:42:56 +00:00
|
|
|
EXPOSE 3002
|
2025-05-06 16:41:05 +00:00
|
|
|
|
|
|
|
|
CMD ["./whatsapp-sender"]
|