diff --git a/Dockerfile b/Dockerfile index 1894de06..f86ff026 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,22 +12,19 @@ COPY . . # Use build cache for Go modules and build RUN --mount=type=cache,target=/root/.cache/go-build \ - --mount=type=cache,target=/go/pkg/mod \ + --mount=type=cache,target=/root/go/pkg/mod \ go build -o otto8 main.go # Second Stage: Final FROM cgr.dev/chainguard/wolfi-base -# Set the working directory -WORKDIR /app +RUN apk add --no-cache git tini # Copy the compiled application from the builder stage -COPY --from=builder /app/otto8 . - -VOLUME /data +COPY --link --from=builder /app/otto8 /bin/ ENV HOME=/data - WORKDIR /data +VOLUME /data # Command to run the application -CMD ["../otto8", "server"] +CMD ["tini", "--", "otto8", "server"] diff --git a/pkg/api/server/server.go b/pkg/api/server/server.go index 95282170..37505151 100644 --- a/pkg/api/server/server.go +++ b/pkg/api/server/server.go @@ -78,7 +78,7 @@ func (s *Server) wrap(f api.HandlerFunc) http.HandlerFunc { func GetURLPrefix(req api.Context) string { if req.Request.TLS == nil { - return "http://" + req.Request.Host + return "http://" + req.Request.Host + "/api" } - return "https://" + req.Request.Host + return "https://" + req.Request.Host + "/api" }