feat: migrate auth0mock from Node.js to Go

Refactor the application to a Go-based architecture for improved
performance and maintainability. Replace the Dockerfile to utilize a
multi-stage build process, enhancing image efficiency. Implement
comprehensive session store tests to ensure reliability and create
new OAuth handlers for managing authentication efficiently. Update 
documentation to reflect these structural changes.
This commit is contained in:
2025-12-29 16:30:37 +01:00
parent 96453e1d15
commit 9992fb4ef1
25 changed files with 1976 additions and 1991 deletions
+24 -10
View File
@@ -1,12 +1,26 @@
FROM amd64/node:24.12.0@sha256:e8bb5aafe1964147c8344b1ea7698218e3675340407a07a14c49901df97455f6
FROM golang:1.24 AS build
ARG GITLAB_USER
ARG GITLAB_TOKEN
WORKDIR /build
ENV CGO_ENABLED=0
ENV GOPRIVATE=gitlab.com/unboundsoftware/*
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -ldflags="-s -w" -o /release/service ./cmd/service
FROM gcr.io/distroless/static-debian12
ENV TZ=Europe/Stockholm
ENV AUDIENCE="https://shiny.unbound.se"
ENV ORIGIN_HOST="auth0mock"
ENV ORIGIN="https://auth0mock:3333"
COPY --from=build /release/service /service
COPY public /public
EXPOSE 3333
WORKDIR /app
ADD package.json yarn.lock /app/
RUN yarn install --frozen-lockfile
ADD *.js /app/
ADD public /app/public
RUN mkdir -p /root/.config
ENTRYPOINT ["yarn", "start"]
ENTRYPOINT ["/service"]