27 lines
477 B
Docker
27 lines
477 B
Docker
FROM golang:1.19-alpine AS builder
|
|||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
COPY go.mod go.sum ./
|
||
|
|
RUN go mod download
|
||
|
|
|
||
|
|
COPY . .
|
||
|
|
|
||
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o tts-api .
|
||
|
|
|
||
|
|
FROM alpine:3.18
|
||
|
|
|
||
|
|
RUN apk --no-cache add ca-certificates tzdata
|
||
|
|
|
||
|
|
WORKDIR /app
|
||
|
|
|
||
|
|
COPY --from=builder /app/tts-api .
|
||
|
|
COPY --from=builder /app/health.html .
|
||
|
|
|
||
|
|
EXPOSE 8080
|
||
|
|
|
||
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
|
||
|
|
CMD wget -qO- http://localhost:8080/health || exit 1
|
||
|
|
|
||
|
|
ENTRYPOINT ["./tts-api"]
|