Feat: Backend scaffolding and local dev stack
This commit is contained in:
36
Backend/Dockerfile
Normal file
36
Backend/Dockerfile
Normal file
@@ -0,0 +1,36 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
FROM golang:1.25.7-alpine AS base
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
RUN apk add --no-cache ca-certificates curl git tzdata && update-ca-certificates
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
FROM base AS development
|
||||
|
||||
RUN curl -fsSL https://raw.githubusercontent.com/air-verse/air/master/install.sh | sh -s -- -b /usr/local/bin
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["air", "-c", ".air.web.toml"]
|
||||
|
||||
FROM base AS builder
|
||||
|
||||
ARG SERVICE_NAME=web
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /out/app ./cmd/${SERVICE_NAME}
|
||||
|
||||
FROM alpine:3.22 AS runtime
|
||||
|
||||
RUN apk add --no-cache ca-certificates tzdata && update-ca-certificates
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /out/app /usr/local/bin/app
|
||||
|
||||
CMD ["/usr/local/bin/app"]
|
||||
Reference in New Issue
Block a user