dockerize event proxy go app

This commit is contained in:
Travis Shears 2025-12-25 11:34:42 +01:00
parent aa5a4eda05
commit 83e3765247
Signed by: travisshears
GPG key ID: CB9BF1910F3F7469
5 changed files with 63 additions and 8 deletions

30
event_proxy/Dockerfile Normal file
View file

@ -0,0 +1,30 @@
# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Install git, gcc, musl-dev, and sqlite-dev for go mod and CGO
RUN apk add --no-cache git gcc musl-dev sqlite-dev
# Copy go mod and sum files
COPY go.mod go.sum ./
# Download dependencies
RUN go mod download
COPY ./*.go .
# Enable CGO for go-sqlite3
ENV CGO_ENABLED=1
RUN go build -o main .
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/main .
EXPOSE 8080
CMD ["./main"]