- Register by signing service key: GET /v1/service-key, POST /v1/auth/register-by-signature - Login auto-attempts register first for new users - Web: default API URL momswap.produktor.duckdns.org, /libs/ static handler - Docker: webbuild stage for geo-api-client, copy web+libs to runtime - Bin scripts: test.sh, run.sh, up.sh, down.sh - docs/ed25519-security-use-cases.md: use cases, message formats, examples - SERVICE_PUBLIC_KEY env (defaults to ADMIN_PUBLIC_KEY) Made-with: Cursor
This commit is contained in:
+17
@@ -22,15 +22,32 @@ RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
CGO_ENABLED=0 GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH} \
|
||||
go build -p "$(nproc)" -trimpath -ldflags="-s -w" -o /out/api ./cmd/api
|
||||
|
||||
FROM base AS webbuild
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends unzip curl && rm -rf /var/lib/apt/lists/* \
|
||||
&& curl -fsSL https://bun.sh/install | bash \
|
||||
&& mv /root/.bun/bin/bun /usr/local/bin/ && rm -rf /root/.bun
|
||||
WORKDIR /src/libs/geo-api-client
|
||||
RUN bun install && bun run build
|
||||
|
||||
FROM base AS dev
|
||||
ENV ADDR=:8122
|
||||
EXPOSE 8122
|
||||
CMD ["go", "run", "./cmd/api"]
|
||||
|
||||
FROM base AS test
|
||||
USER root
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends unzip curl && rm -rf /var/lib/apt/lists/* \
|
||||
&& curl -fsSL https://bun.sh/install | bash \
|
||||
&& mv /root/.bun/bin/bun /usr/local/bin/ && rm -rf /root/.bun
|
||||
WORKDIR /src
|
||||
CMD ["sh", "-c", "go test ./... && cd libs/geo-api-client && bun install && bun test"]
|
||||
|
||||
FROM gcr.io/distroless/static-debian12:nonroot AS runtime
|
||||
|
||||
WORKDIR /app
|
||||
COPY --from=builder /out/api /app/api
|
||||
COPY --from=builder /src/web /app/web
|
||||
COPY --from=webbuild /src/libs /app/libs
|
||||
|
||||
ENV ADDR=:8122
|
||||
EXPOSE 8122
|
||||
|
||||
Reference in New Issue
Block a user