feat: add Go microservice, Dockerfile, docker-compose, and API submission endpoint

This commit is contained in:
2026-08-12 17:20:03 +02:00
parent ad02939b88
commit 0ee82eb673
24 changed files with 316 additions and 6 deletions
+24
View File
@@ -0,0 +1,24 @@
# Stage 1: Build the Go binary
FROM golang:1.22-alpine AS builder
WORKDIR /app
COPY go.mod ./
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o server .
# Stage 2: Ultra-lightweight runtime container
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
WORKDIR /app
# Copy binary and static front-end assets
COPY --from=builder /app/server /app/server
COPY --from=builder /app/public /app/public
EXPOSE 8080
ENTRYPOINT ["/app/server"]