whatapp-go/Dockerfile

26 lines
529 B
Docker
Raw Normal View History

2025-05-06 16:41:05 +00:00
# Build stage
2025-05-06 16:53:53 +00:00
FROM golang:1.24-alpine AS builder
2025-05-06 16:16:42 +00:00
2025-05-06 16:59:47 +00:00
# Installer les dépendances nécessaires pour SQLite3
RUN apk add --no-cache gcc musl-dev
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 . .
2025-05-06 16:59:47 +00:00
RUN CGO_ENABLED=1 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:59:47 +00:00
# Installer les librairies nécessaires pour SQLite3
RUN apk add --no-cache libc6-compat
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:51:44 +00:00
EXPOSE 8080
2025-05-06 16:41:05 +00:00
CMD ["./whatsapp-sender"]