Skip to content

Commit

Permalink
bug: fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
ibuildthecloud committed Oct 18, 2024
1 parent 00df91d commit 4530f71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
13 changes: 5 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions pkg/api/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

0 comments on commit 4530f71

Please sign in to comment.