Files
healthflow/server/Dockerfile
2025-12-20 23:51:40 +08:00

22 lines
486 B
Docker

FROM --platform=linux/amd64 golang:1.21-alpine AS builder
RUN apk add --no-cache gcc musl-dev sqlite-dev
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o healthflow-server .
FROM --platform=linux/amd64 alpine:latest
RUN apk --no-cache add ca-certificates sqlite-libs
WORKDIR /app
COPY --from=builder /app/healthflow-server .
RUN mkdir -p /app/data
EXPOSE 8080
CMD ["./healthflow-server"]