Dockerfile 431 B

123456789101112131415161718192021222324
  1. # syntax=docker/dockerfile:1
  2. # Build the application from source
  3. FROM golang:1.23 AS build
  4. WORKDIR /
  5. COPY . .
  6. RUN go mod download
  7. RUN CGO_ENABLED=0 GOOS=linux go build -o /yosai-server ./cmd/yosai-server/yosai-server.go
  8. # Deploy the application binary into a lean image
  9. FROM alpine:latest AS multi
  10. WORKDIR /
  11. COPY --from=build /yosai-server /yosai-server
  12. RUN chmod ugo+x /yosai-server
  13. EXPOSE 8080
  14. CMD [ "/yosai-server" ]