Dockerfile.api 303 B

1234567891011121314
  1. FROM golang:1.23-alpine AS builder
  2. WORKDIR /app
  3. ENV GOTOOLCHAIN=auto
  4. COPY go.mod go.sum ./
  5. RUN go mod download
  6. COPY . .
  7. RUN CGO_ENABLED=0 GOOS=linux go build -o /app/server ./cmd/server
  8. FROM alpine:3.19
  9. WORKDIR /app
  10. COPY --from=builder /app/server .
  11. COPY configs/ configs/
  12. EXPOSE 8080
  13. CMD ["./server"]