Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,25 @@ COPY ./go.sum ./
RUN go install -buildvcs=false -ldflags "-X main.build=${VERSION}" ./cmd/...
RUN go install -buildvcs=false -ldflags "-X main.build=${VERSION}" ./tools/...

FROM node:alpine AS ui-builder
WORKDIR /app
COPY ./ui ./
RUN npm install
RUN npm run build

FROM alpine:latest
RUN apk add --no-cache libstdc++ gcompat libgomp
RUN apk add --update busybox>1.3.1-r0
RUN apk add --update openssl>3.1.4-r1


RUN apk add --update nodejs npm
RUN apk add --update apache2-utils
RUN apk add --update libwebp=1.3.2-r0
RUN apk add --update openssl>3.1.4-r1
RUN apk add curl

COPY --from=base ./service/api ./api
COPY --from=base ./service/bin/* ./
COPY --from=base ./service/pkg/credentials ./pkg/credentials
COPY --from=base ./service/resolvers_settings.* ./
COPY --from=base ./service/resolvers_settings.* ./
COPY --from=ui-builder ./app/dist ./ui/dist

29 changes: 28 additions & 1 deletion internal/api/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,36 @@ func (s *Server) Health(_ context.Context, _ HealthRequestObject) (HealthRespons

// RegisterStatic add method to the mux that are not documented in the API.
func RegisterStatic(mux *chi.Mux) {
mux.Get("/", documentation)
mux.Get("/docs", documentation)
mux.Get("/static/docs/api/api.yaml", swagger)
mux.Get("/favicon.ico", favicon)
fs := http.FileServer(http.Dir("./ui/dist/"))
mux.Get("/schemas", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/", http.StatusFound)
})
mux.Route("/credentials", func(r chi.Router) {
r.Get("/*", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/", http.StatusFound)
})
})
mux.Route("/connections", func(r chi.Router) {
r.Get("/*", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/", http.StatusFound)
})
})
mux.Route("/issuer-state", func(r chi.Router) {
r.Get("/*", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/", http.StatusFound)
})
})
mux.Route("/identities", func(r chi.Router) {
r.Get("/*", func(w http.ResponseWriter, r *http.Request) {
http.Redirect(w, r, "/", http.StatusFound)
})
})
mux.Handle("/*", http.StripPrefix("/", fs))
mux.Handle("/assets/*", fs)
mux.Handle("/images/*", fs)
}

func documentation(w http.ResponseWriter, _ *http.Request) {
Expand Down
3 changes: 1 addition & 2 deletions ui/src/adapters/env.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ export const envParser = getStrictParser<EnvInput, Env>()(
.transform(
({
VITE_API_PASSWORD,
VITE_API_URL,
VITE_API_USERNAME,
VITE_BUILD_TAG,
VITE_IPFS_GATEWAY_URL,
Expand All @@ -46,7 +45,7 @@ export const envParser = getStrictParser<EnvInput, Env>()(
}): Env => ({
api: {
password: VITE_API_PASSWORD,
url: VITE_API_URL,
url: "/",
username: VITE_API_USERNAME,
},
buildTag: VITE_BUILD_TAG,
Expand Down