dockerize event proxy go app
This commit is contained in:
parent
aa5a4eda05
commit
83e3765247
5 changed files with 63 additions and 8 deletions
30
event_proxy/Dockerfile
Normal file
30
event_proxy/Dockerfile
Normal 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue