Поддержка docker

This commit is contained in:
Alexander NeonXP Kiryukhin 2024-06-08 22:01:48 +03:00
parent 9b163660df
commit f913da4c3f
Signed by: NeonXP
GPG key ID: 35E33E1AB7776B39
7 changed files with 23 additions and 11 deletions

12
Dockerfile Normal file
View file

@ -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"]

View file

@ -1,5 +1,5 @@
[![Go Report Card](https://goreportcard.com/badge/github.com/n0x1m/gmifs)](https://goreportcard.com/report/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/github.com/n0x1m/gmifs?status.svg)](https://godoc.org/github.com/n0x1m/gmifs) [![GoDoc](https://godoc.org/gitrepo.ru/neonxp/gmifs?status.svg)](https://godoc.org/gitrepo.ru/neonxp/gmifs)
# 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: 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 ### Development

View file

@ -12,7 +12,7 @@ import (
"path/filepath" "path/filepath"
"strings" "strings"
"github.com/n0x1m/gmifs/gemini" "gitrepo.ru/neonxp/gmifs/gemini"
) )
var ( var (

4
go.mod
View file

@ -1,3 +1,3 @@
module github.com/n0x1m/gmifs module gitrepo.ru/neonxp/gmifs
go 1.16 go 1.22

View file

@ -13,9 +13,9 @@ import (
"syscall" "syscall"
"time" "time"
"github.com/n0x1m/gmifs/fileserver" "gitrepo.ru/neonxp/gmifs/fileserver"
"github.com/n0x1m/gmifs/gemini" "gitrepo.ru/neonxp/gmifs/gemini"
"github.com/n0x1m/gmifs/middleware" "gitrepo.ru/neonxp/gmifs/middleware"
) )
const ( const (

View file

@ -3,7 +3,7 @@ package middleware
import ( import (
"sync" "sync"
"github.com/n0x1m/gmifs/gemini" "gitrepo.ru/neonxp/gmifs/gemini"
) )
type cache struct { type cache struct {

View file

@ -6,7 +6,7 @@ import (
"strings" "strings"
"time" "time"
"github.com/n0x1m/gmifs/gemini" "gitrepo.ru/neonxp/gmifs/gemini"
) )
func Logger(log *log.Logger, prefix string) func(gemini.Handler) gemini.Handler { func Logger(log *log.Logger, prefix string) func(gemini.Handler) gemini.Handler {