cmc-sales/Dockerfile.stg.go

22 lines
538 B
Docker
Raw Normal View History

FROM golang:1.24-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go/go.mod go/go.sum ./
RUN go mod download
COPY go/ .
RUN go install github.com/sqlc-dev/sqlc/cmd/sqlc@latest
RUN sqlc generate
2025-11-19 05:42:29 -08:00
RUN go mod tidy
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server cmd/server/main.go
FROM alpine:latest
2025-09-17 04:18:27 -07:00
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /root/
COPY --from=builder /app/server .
COPY go/templates ./templates
COPY go/static ./static
COPY go/.env.example .env
EXPOSE 8082
CMD ["./server"]