Files
smart-search-back/Dockerfile
vallyenfail d959dcca96 add service
2026-01-17 17:39:33 +03:00

33 lines
740 B
Docker

FROM golang:1.23-alpine AS builder
RUN apk add --no-cache git make protobuf-dev
WORKDIR /app
COPY go.mod go.sum ./
ENV GOTOOLCHAIN=auto
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server cmd/server/main.go
FROM alpine:latest
RUN apk --no-cache add ca-certificates postgresql-client bash
WORKDIR /root/
COPY --from=builder /app/server .
COPY --from=builder /app/migrations ./migrations
COPY --from=builder /app/config/boot.yaml ./config/boot.yaml
COPY --from=builder /app/config/config.yaml ./config/config.yaml
COPY --from=builder /app/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
EXPOSE 9091
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["./server"]