mov to src_dir

This commit is contained in:
2025-12-02 20:32:05 +01:00
parent ac5d515ac3
commit 74ef60fb5f
7 changed files with 33 additions and 7 deletions

6
.idea/vcs.xml generated Normal file
View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
</component>
</project>

Binary file not shown.

25
src/Dockerfile Normal file
View File

@@ -0,0 +1,25 @@
FROM --platform=$BUILDPLATFORM golang:1.25.1-alpine AS build
ARG TARGETOS
ARG TARGETARCH
WORKDIR /src
COPY go.mod go.sum ./
RUN --mount=type=cache,target=/go/pkg/mod \
go mod download
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH \
go build -trimpath -ldflags="-s -w" -o /out/app .
FROM gcr.io/distroless/static-debian12:nonroot
COPY --from=build /out/app /app
USER nonroot:nonroot
# EXPOSE 8080
ENTRYPOINT ["/app"]

View File

@@ -176,13 +176,8 @@ func main() {
if port == "" {
port = "8080"
}
exePath, err := os.Executable()
if err != nil {
log.Fatalf("failed to get executable path: %v", err)
}
exeDir := filepath.Dir(exePath)
cacheFilePath := filepath.Join(exeDir, "cache.xml")
cacheFilePath := filepath.Join(os.TempDir(), "cache.xml")
cache := &Cache{
filePath: cacheFilePath,

View File

0
src/go.sum Normal file
View File