ADD: added dockerfiles and a logger for the backend
This commit is contained in:
29
Dockerfile.backend
Normal file
29
Dockerfile.backend
Normal file
@@ -0,0 +1,29 @@
|
||||
# =========================
|
||||
# Build stage
|
||||
# =========================
|
||||
FROM golang:1.25.5-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY backend/go.mod backend/go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY backend/ ./
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
go build -o server ./cmd/server
|
||||
|
||||
|
||||
# =========================
|
||||
# Runtime stage
|
||||
# =========================
|
||||
FROM gcr.io/distroless/base-debian12
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app/server ./server
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
USER nonroot:nonroot
|
||||
ENTRYPOINT ["./server"]
|
||||
Reference in New Issue
Block a user