From f913da4c3f26fdf260f8f17086d271369339f1ed Mon Sep 17 00:00:00 2001 From: Alexander NeonXP Kiryukhin Date: Sat, 8 Jun 2024 22:01:48 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=B4=D0=B5=D1=80=D0=B6?= =?UTF-8?q?=D0=BA=D0=B0=20docker?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 12 ++++++++++++ README.md | 6 +++--- fileserver/fileserver.go | 2 +- go.mod | 4 ++-- main.go | 6 +++--- middleware/cache.go | 2 +- middleware/logger.go | 2 +- 7 files changed, 23 insertions(+), 11 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b2b823c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,12 @@ +FROM golang:1.22 + +WORKDIR /usr/src/app + +# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change +COPY go.mod ./ +RUN go mod download && go mod verify + +COPY . . +RUN go build -v -o /usr/local/bin/gmifs . + +ENTRYPOINT ["gmifs"] \ No newline at end of file diff --git a/README.md b/README.md index c05fc8b..0ec3a56 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -[![Go Report Card](https://goreportcard.com/badge/github.com/n0x1m/gmifs)](https://goreportcard.com/report/github.com/n0x1m/gmifs) -[![GoDoc](https://godoc.org/github.com/n0x1m/gmifs?status.svg)](https://godoc.org/github.com/n0x1m/gmifs) +[![Go Report Card](https://goreportcard.com/badge/gitrepo.ru/neonxp/gmifs)](https://goreportcard.com/report/gitrepo.ru/neonxp/gmifs) +[![GoDoc](https://godoc.org/gitrepo.ru/neonxp/gmifs?status.svg)](https://godoc.org/gitrepo.ru/neonxp/gmifs) # gmifs @@ -26,7 +26,7 @@ server? Because it's educational and that's the spirit of the protocol. Currently only supported through the go toolchain, either check out the repot and build it or use: ``` -go install github.com/n0x1m/gmifs +go install gitrepo.ru/neonxp/gmifs ``` ### Development diff --git a/fileserver/fileserver.go b/fileserver/fileserver.go index 5f6b3b3..7db4a5d 100644 --- a/fileserver/fileserver.go +++ b/fileserver/fileserver.go @@ -12,7 +12,7 @@ import ( "path/filepath" "strings" - "github.com/n0x1m/gmifs/gemini" + "gitrepo.ru/neonxp/gmifs/gemini" ) var ( diff --git a/go.mod b/go.mod index dad1097..0fd0d8b 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module github.com/n0x1m/gmifs +module gitrepo.ru/neonxp/gmifs -go 1.16 +go 1.22 diff --git a/main.go b/main.go index 958a61b..3751252 100644 --- a/main.go +++ b/main.go @@ -13,9 +13,9 @@ import ( "syscall" "time" - "github.com/n0x1m/gmifs/fileserver" - "github.com/n0x1m/gmifs/gemini" - "github.com/n0x1m/gmifs/middleware" + "gitrepo.ru/neonxp/gmifs/fileserver" + "gitrepo.ru/neonxp/gmifs/gemini" + "gitrepo.ru/neonxp/gmifs/middleware" ) const ( diff --git a/middleware/cache.go b/middleware/cache.go index 45bcc3e..59e301c 100644 --- a/middleware/cache.go +++ b/middleware/cache.go @@ -3,7 +3,7 @@ package middleware import ( "sync" - "github.com/n0x1m/gmifs/gemini" + "gitrepo.ru/neonxp/gmifs/gemini" ) type cache struct { diff --git a/middleware/logger.go b/middleware/logger.go index 834e4d2..eac301d 100644 --- a/middleware/logger.go +++ b/middleware/logger.go @@ -6,7 +6,7 @@ import ( "strings" "time" - "github.com/n0x1m/gmifs/gemini" + "gitrepo.ru/neonxp/gmifs/gemini" ) func Logger(log *log.Logger, prefix string) func(gemini.Handler) gemini.Handler {