Rename the module, proto service, and all identifiers from simple_bank/ SimpleBank to api_tmpl/ApiTmpl, and regenerate the gRPC/gateway/swagger/ mock code accordingly. - Scrub real secrets (SMTP password, auth token secret) from api.env/ api_test.env, untrack them, and add api.env.example/api_test.env.example - Remove committed build artifacts (tmp/main, tmp/build-errors.log, dbml-error.log) and gitignore them going forward - Fix Dockerfile paths (build target, migrations copy) that referenced a stale project layout - Rewrite README to match the actual cmd/ + internal/ structure and add a "using this as a template" section
26 lines
356 B
Docker
26 lines
356 B
Docker
#Build stage
|
|
FROM golang:1.25.4-alpine3.22 AS builder
|
|
|
|
WORKDIR /api
|
|
|
|
COPY . .
|
|
|
|
RUN go build -o main ./cmd/api
|
|
|
|
|
|
#Run stage
|
|
FROM alpine:3.22
|
|
WORKDIR /api
|
|
|
|
COPY --from=builder /api/main .
|
|
COPY api.env .
|
|
COPY start.sh .
|
|
COPY wait-for.sh .
|
|
COPY cmd/db/migrations ./cmd/db/migrations
|
|
|
|
EXPOSE 8080
|
|
EXPOSE 9090
|
|
|
|
CMD [ "/api/main" ]
|
|
ENTRYPOINT [ "/api/start.sh" ]
|