Inception/srcs/requirements/mailhog/Dockerfile
2025-07-17 18:24:39 +02:00

30 lines
567 B
Docker

FROM alpine:3.21 AS builder
RUN apk add --no-cache \
go \
git \
netcat-openbsd \
&& rm -rf /var/cache/apk/*
ENV GOROOT /usr/lib/go
ENV GOPATH /go
ENV PATH /go/bin:$PATH
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin
ENV GOTOOLCHAIN=auto
RUN go install github.com/mailhog/MailHog@latest
FROM alpine:3.20
ARG HOST_UID=1000
RUN adduser -D -u ${HOST_UID} mailhog
COPY --from=builder /go/bin/MailHog /usr/local/bin/MailHog
CMD ["MailHog"]
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
CMD nc -z localhost 8025 || exit 1