mov to src_dir
This commit is contained in:
6
.idea/vcs.xml
generated
Normal file
6
.idea/vcs.xml
generated
Normal 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>
|
||||
BIN
epg-cacher.exe
BIN
epg-cacher.exe
Binary file not shown.
25
src/Dockerfile
Normal file
25
src/Dockerfile
Normal 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"]
|
||||
@@ -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,
|
||||
0
src/go.sum
Normal file
0
src/go.sum
Normal file
Reference in New Issue
Block a user